ES如何创建索引及进行配置和mapping

PUT document_index
{
  "settings": {
    "analysis": {
      "analyzer": {
        "ik": {
          "tokenizer": "ik_max_word"
        }
      }
    },
    "number_of_shards": 5,
    "number_of_replicas": 1
  },
  "mappings": {
    "dynamic": false,
    "_source": {
      "enabled": false
    },
    "properties": {
      "document_id": {
        "type": "keyword"
      },
      "title": {
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "author": {
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "kbase_id": {
        "type": "keyword"
      },
      "content": {
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "tags": {
        "type": "text",
        "analyzer": "whitespace"
      }
    }
  }
}

 

posted on 2022-04-14 09:55  MaXianZhe  阅读(1939)  评论(0编辑  收藏  举报

导航