美文网首页
ES查询解疑

ES查询解疑

作者: byamao1 | 来源:发表于2018-09-20 23:26 被阅读0次

    【官方文档】
    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可以被缓存并且不打分。

    相关文章

      网友评论

          本文标题:ES查询解疑

          本文链接:https://www.haomeiwen.com/subject/suuonftx.html