【发布时间】:2021-02-10 01:08:57
【问题描述】:
我有一个未返回数据的弹性搜索查询。这是查询的 2 个示例 - 第一个有效并返回一些记录,但第二个不返回任何内容 - 我错过了什么?
示例 1 的工作原理:
curl -X GET "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d'
{
"query": {
"match": {
"data.case.field1": "ABC123"
}
}
}
'
示例 2 不起作用:
curl -X GET "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d'
{
"query": {
"bool": {
"must": {
"term" : { "data.case.field1" : "ABC123" }
}
}
}
}
'
【问题讨论】:
标签: elasticsearch elasticsearch-query term-query