美文网首页
010 term 查询与match_phrase区别

010 term 查询与match_phrase区别

作者: zhu733756 | 来源:发表于2020-03-20 18:22 被阅读0次

    # # term 查询与match_phrase区别

    # term >range>exists>prefix>wildcard

    #严格keyword匹配,filter可以利用缓存,忽略TF—IDF计算

    POST kibana_sample_data_ecommerce/_search

    {

      "size": 20,

      "query": {

        "constant_score": {

          "filter": {

            "term": {

              "products.product_name.keyword": "Basic T-shirt - dark blue/white"

            }

          }

        }

      }

    }

    POST kibana_sample_data_ecommerce/_search

    {

      "size": 20,

      "query": {

        "match_phrase": {

          "products.product_name": {

            "query": "Basic white",

            "slop":4

          }

        }

      }

    }

    # term >range>exists>prefix>wildcard

    #严格keyword匹配,filter可以利用缓存,忽略TF—IDF计算

    POST kibana_sample_data_ecommerce/_search

    {

      "size": 20,

      "query": {

        "constant_score": {

          "filter": {

            "term": {

              "products.product_name.keyword": "Basic T-shirt - dark blue/white"

            }

          }

        }

      }

    }

    POST kibana_sample_data_ecommerce/_search

    {

      "size": 20,

      "query": {

        "match_phrase": {

          "products.product_name": {

            "query": "Basic white",

            "slop":4

          }

        }

      }

    }

    相关文章

      网友评论

          本文标题:010 term 查询与match_phrase区别

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