[英]Elasticsearch the terms filter raise “filter does not support [mediatest]”
[英]terms query does not support multiple fields
有沒有一種方法可以編寫一個OR查詢,該OR查詢使用與field1的術語匹配(或)與使用field2的術語匹配。...得到一條消息“ [terms]查詢不支持多個字段” ...應該是一種方法: -
"constant_score":{
"filter":{
"bool":{
"should":{
"terms":{
"field1 ":[
"017M0",
"000XXJ0900"
],
"field2":[
"017M0",
"000XXJ0900"
]
}
}
}
}
}
使用應該作為OR子句並具有如下定義的多個術語..解決了我的問題。
"bool":{
"should": [
{
"terms": {
"field1": [ "017M0v", "000XXJ0900v" ]
}
},
{
"terms": {
"field2": [ "017M0", "000XXJ0900"]
}
}
]
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.