I try to learn Elasticsearch to add it in my Rails app. I want to perform a multi_match query into 2 fields (as if they were just a single field) and also have a filter to a
Use a filtered query:
{
"query": {
"filtered": {
"query": {
"multi_match": {
"query": "test",
"fields": [
"winery",
"name"
]
}
},
"filter": {
"term": {
"status": "1"
}
}
}
}
}
Same query for Elasticsearch 5:
{
"query": {
"bool": {
"must": {
"multi_match": {
"query": "test",
"fields": [
"winery",
"name"
]
}
},
"filter": {
"term": {
"status": "1"
}
}
}
}
}