0
我想寫一個查詢,要求「區域」爲530,「開始」爲06192013或「區域」爲「530」,「開始」爲「空白」 。此外,在這兩種場景中,「空間」爲「頂部」或「空間2」爲「底部」。這個查詢似乎在抓取任何匹配這些場景的任何東西,我如何改變它以使其像我想要的那樣工作?創建彈性搜索和或查詢
{
"size":25,
"from":0,
"query": {
"custom_filters_score": {
"query": {
"filtered": {
"query": {
"bool": {
"must": [
{"term":{"type":"ghost"}},
{"term":{"area":"530"}}
]
}
},
"filter" : {
"or": [
{"terms":{"space": ["top"]}},
{"terms":{"space2":["bottom"]}},
{
"and": [
{"term":{"area":"530"}},
{"term":{"start":"06192013"}}
]
},
{
"and": [
{"term":{"area":"530"}},
{"term":{"starts":"blank"}}
]
}
]
}
}
},
"filters": [
{"filter":{"term":{"filter1":5743}}, "boost":"1000"},
{"filter":{"term":{"filter2":4451}}, "boost":"64"},
{"filter":{"term":{"filter3":["tech"]}}, "boost":"16"},
{"filter":{"terms":{"filter4":[]}}, "boost":"8"},
{"filter":{"terms":{"filter5":[]}}, "boost":"5"},
{"filter":{"term":{"access":"1"}}, "boost":"2"}
],
"score_mode":"total"
}
}
}