本篇侧重讲解说明如何对index进行创建、更改、迁移、查询配置信息等。
仅创建索引:PUT index
PUT /index
添加字段设置(mappings):PUT index/_mapping/type,如:(properties下均为索引字段)
PUT /index/_mapping/_doc
{
"properties": {
"email": {
"type": "keyword"
}
}
}
添加索引设置(settings):PUT /index/_settings,如:
PUT /index/_settings
{
"number_of_shards":"8",
"max_inner_result_window":"130000",
"max_result_window":"130000",
"analysis":{
"analyzer":{
"ngram_analyzer":{
"tokenizer":"ngram_tokenizer"
}
},
"tokenizer":{
"ngram_tokenizer":{
&#