ES数据库创建索引

1. 进入Dev Tools

2. 将下列内容粘贴过去,(对内容进行修改‘id’对应位置就是字段)

PUT /kpwiki
{
  "settings": {
    "number_of_shards": "2",
    "number_of_replicas": "1"
  },
  "mappings": {
    "properties": {
        "id": {
          "type": "long"
        },
        "app_id": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "name": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "source_url": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "status": {
          "type": "long"
        },
        "create_time": {
          "type": "date"
        },
        "update_time": {
          "type": "date"
        },
        "content": {
          "type": "text",
          "analyzer": "ik_smart",
          "search_analyzer": "ik_smart"
        },
        "rich_content": {
          "type": "text",
          "analyzer": "ik_smart",
          "search_analyzer": "ik_smart"
        }
      }
    }
}

 

上一篇:css实现开关效果


下一篇:ElasticSearch-ik分词器