Can i "post_filter" multiple fields?


(Kenshero) #1

this DSL my elasticsearch

{
"query": {
"multi_match": {
"query": "text_search xxxxxxx",
"type" : "phrase_prefix",
"fields": ["xxxxxx","yyyyyyy"]
}
},
"post_filter": {
"terms": {
"field xxxxx ": [
"xxxxx",
"yyyyy"
]
}
}
}

How i query multiple field in post_filter ? Help me pls .

Thank you


(Nik Everett) #2

You can use a bool query for that.


(Kenshero) #3

how to ? can example me ?


(Nik Everett) #4

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html good enough? You can put the bool right into the post_filter.


(Kenshero) #5

thank you .


(system) #6