Elasticsearch如何创建自定义mapping?

提问者:帅平 问题分类:搜索引擎
Elasticsearch如何创建自定义mapping?

 您阅读本篇文章共花了: 

1 个回答
勿忘心安
勿忘心安
Elasticsearch创建自定义mapping的实力如下:
PUT my_index   
{  
   "settings" : {  
      "number_of_shards" : 5,  
      "number_of_replicas" : 1  
   }  
  "mappings": {  
    "_doc": {   
      "properties": {   
        "title":    { "type": "text"  },   
        "name":     { "type": "text"  },   
        "age":      { "type": "integer" },    
        "created":  {  
          "type":   "date",   
          "format": "strict_date_optional_time||epoch_millis"  
        }  
      }  
    }  
  }  
}
发布于:3周前 (04-02) IP属地:四川省
我来回答