1.创建索引
1.1 简单创建
put http://47.100.110.37/index
"settings": {
"number_of_shards": 3, //主分片默认为5个
"number_of_replicas": 2 //副分片默认为1个
}
1.2 带映射创建
put http://47.100.110.37/index
{
"settings":{
"number_of_shards":5,
"number_of_replicas":5
},
"mapping":{
"movie":{
"properties":{
"title":{
"type":"text",
"analyzer":"english"
},
"tagline":{
"type":"text",
"analyzer":"english"
},
"release_date":{
"type":"date",
"format":"yyyy-MM-dd||yyyy-M-dd||yyyy-MM-d||yyyy-M-d"
},
"popularity":{
"type":"long"
},
"overview":{
"type":"text",
"analyzer":"english"
}
}
}
}
}
1.3更新索引副本数
put http://47.100.110.37/index/_settings
{"number_of_replicas": 3}//主分片不可更改