一、创建索引:
PUT testli1 (索引名)
{
"settings" : {
"index" :{
"number_of_shards" : 1, (主分片数)
"number_of_replicas" :1 (副本分票)
}
}
}
二、创建索引模板:
PUT /_template/testli1
{
"index_patterns": ["test*", "li*"],
"settings": {
"index": {
"number_of_shards" : 1,
"number_of_replicas" : 1
}
}
}
三、定义类型例子:
PUT test6
{
"mappings": { (定义类型)
"properties": { (文件类型参数)
"name" : { "type": "text" }
}
}
}
四、Es 类型种类
例子:
PUT lish11
{
"mappings": {
"properties": {
"id":{
"type": "long"
},
"name": {
"type": "text"
},