(05)es索引创建

非结构索引创建

(05)es索引创建

 

点击刷新出现如下:宽宽的框框代表分片,细细的框框代变备份

 

(05)es索引创建

点击信息--》索引信息

 

(05)es索引创建

 

 

 

结构索引创建

1.点击复杂查询,输入json--点击易读--json检验--提交

 

(05)es索引创建

{

"novel": {

"properties": {

"title": {

"type": "text"

}

}

}

}

 

es7.0以上请求

(05)es索引创建

 

{

"mappings": {

"properties": {

"title": {

"type": "text"

}

}

}

}

 

 

2.使用postman

http://localhost:9200/people put

{

"settings":{

"number_of_shards":3,

"number_of_replicas":2

},

"mappings":{

"properties":{

"id":{"type":"long"},

"name":{"type":"text"},

"text":{"type":"text"}

}

}

}

 

 

杂粮:es5以后支持 移除string 类型 拆分为 text 和 keyword

Text vs. keyword

Text:会分词,然后进行索引

       支持模糊、精确查询

       不支持聚合

keyword:不进行分词,直接索引

       支持模糊、精确查询

       支持聚合