ElasticSearch高级语法
ElasticSearch高级语法
PUT /movie/_doc/1
{
"name":"Eating an apple a day & keeps the doctor away"
}
GET /movie/_search
{
"query": {
"match": {
"name": "eat"
}
}
}
- 使用analyze api 查看分词状态
GET /movie/_analyze { "field": "name", "text":"Eating an apple a day & keeps the doctor away" }
DELETE /movie
- 使用结构化的方式重新创建索引
```PUT /movie { "settings": { "number_of_shards": 1, "number_of_replicas": 0 }, "mappings": { "properties": { "name":{ "type": "text","analyzer": "english" } } } }
GET /movie/_search
再次使用analyze api查看分词状态
再次查询eat关键词
```
正文到此结束
- 本文标签: ElasticSearch
- 本文链接: https://code.jiangjiesheng.cn/article/45
- 版权声明: 本文由小江同学原创发布,转载请先联系本站长,谢谢。