ES查询解疑

2018-09-20  本文已影响0人  byamao1

【官方文档】
https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html

term

叶查询。不对查询字符串进行分词

terms

叶查询。在查询的字段只有一个值的时候,应该使用term而不是terms,在查询字段包含多个的时候才使用terms(类似于sql中的in、or)。注意:使用terms语法,JSON中必须是数组。
ref: http://m.mamicode.com/info-detail-1715468.html

match_phrase

叶查询。对查询字符串进行分词,与match不同之处:文档必须包含所有搜索词条(并且词条位置要邻接。可以通过slop参数进行调整位置的要求)
ref: https://blog.csdn.net/xifeijian/article/details/51090707

filter clause

复合查询bool的clause。其叶查询一般是terms/term/range。与bool.must 的区别在于filter可以被缓存并且不打分。

上一篇下一篇

猜你喜欢

热点阅读