1
我需要一點幫助轉移MySQL查詢到ES。查詢看起來是這樣的Elasticsearch - 或在條件下
SELECT * FROM `xyz` WHERE visibility IN (1,2) AND (active=0 OR (active=1 AND finished=1)
這很容易,使只和條件,但如何使用或長期混合和?
"query" : {
"bool" : {
"must" : [{
"terms" : { "visibility" : ["1", "2"] }
}, {
"term" : { "active" : "1" }
}, {
"term" : { "active" : "0", "finished" : "1" } // OR
},]
}
}
任何運氣嗎? – Val