elasticsearch 使用mapping创建索引

如下:

PUT indexName

{
  "settings": {
    "index": {
      "refresh_interval": "60s",
      "number_of_shards": "2",
      "number_of_replicas": "1"
    }
  },
  "mappings": {
    "_source": {
      "enabled": "false"
    },
    "properties": {
      "name": {
        "type": "text",
        "store": "false",
        "index": "true",
        "analyzer": "standard",
        "search_analyzer": "standard"
      },
      "age": {
        "type": "integer",
        "store": "true",
        "index": "false"
      }
    }
  }
}

标签: analyzer、standard、store、index、shards、面试
  • 回复
隐藏