【发布时间】:2020-09-21 18:50:21
【问题描述】:
我想在弹性搜索上执行这样的查询 =>
select * from orders where customerName = 'google' and Type = 'stackoverflow' and query_string 可以来自任何索引。 (即查询字符串可以是“google”或“stackoverflow”或“a”或“b”或“c”或“d”
table orders:
customerName type column1 column2 column3 column4
google stackoverflow a b c d
apple stackoverflow a b c d
google stackoverflow a b c d
microsoft stackoverflow a b c d
expected output:
google stackoverflow a b c d
google stackoverflow a b c d
即第 1 行和第 3 行
我尝试使用
"query": {
"bool": {
"must": {
"multi_match": {
"query": "b"
}
},
"filter": {
"terms": {
"customerName": [ "google" ],
"type": [ "stackoverflow ]
}
}
}
}
请帮忙:)
【问题讨论】:
-
你试过什么?
-
我更新了我的帖子@SahilGupta
-
您能分享一下您的索引映射吗?
GET my_index/_mapping通过 kibana -
@imDevD 你有机会看我的回答吗,期待得到你的反馈????
标签: elasticsearch