问答详情
源自:5-2 filter

Filter和term使用,为啥查询文本就查询不到结果

{
    "query":{
        "bool":{
            "filter":{
                "term":{
                    "author":"李史峰"
                }
            }
        }
    }
}


返回结果:

{
    "took":2,
    "timed_out":false,
    "_shards":{
        "total":3,
        "successful":3,
        "skipped":0,
        "failed":0
    },
    "hits":{
        "total":0,
        "max_score":null,
        "hits":[

        ]
    }
}

提问者:金色年华ch 2019-12-19 23:22

个回答

  • 慕勒5515572
    2020-04-29 20:01:14

    term:精确查询, 这种查询适合keyword、numeric、date等明确值的,你看你查询的字段类型是不是设置成text了