Manually create a mapping ElasticSearch

Noted earlier on manually created mapping, then on an object on the introduction of the type of storage and mapping , we are going to introduce how to manually create a mapping

#手动创建mapping
PUT /lib6
{
  "settings":{
    "number_of_shards" : 3,
    "number_of_replicas" : 0
  },
  "mappings":{
      "books":{
        "properties":{
          "title" :{"type":"text"},
          "name" :{"type" :"text" ,"analyzer":"standard"},
          "publish_date" :{"type":"date", "index" :false},
          "price" :{"type" :"double"},
          "number":{"type":"integer"}
        }
      }
  }
}

By default, ElasticSearch automatically creates for each field inverted index, if we do not want to be indexed, index: false

Published 298 original articles · won praise 107 · Views 140,000 +

Guess you like

Origin blog.csdn.net/ywl470812087/article/details/104865323