有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!


共 (1) 个答案

  1. # 1 楼答案

    术语过滤器

    术语过滤器用于按精确值进行过滤,可以是数字、日期、布尔值,也可以是未分析的精确值字符串字段:

    { "term": { "age": 26 }} { "term": { "date":
    "2014-09-01" }} { "term": { "public": true }} { "term": { "tag": "full_text" }}

    Bool过滤器

    布尔滤波器由三部分组成:

    { "bool" : { "must" : [], "should" : [], "must_not" : [], } }

    必须

    所有这些条款必须一致。相当于和

    不得

    所有这些条款都不能匹配。相当于没有

    应该

    这些条款中至少有一条必须匹配。相当于或。 就这样!当您需要多个过滤器时,只需将它们放入布尔过滤器的不同部分

    检查以下链接可能会有所帮助:

    https://www.elastic.co/guide/en/elasticsearch/guide/current/combining-filters.html

    https://www.elastic.co/guide/en/elasticsearch/guide/current/_most_important_queries_and_filters.html