I am trying to learn Elasticsearch to add it to my Rails application. I want to execute a multi_match request in 2 fields (as if they were only one field), and also have a filter for another field (state), which should be 1.
response = Wine.search({ query: { multi_match: { query: "test", fields: ["winery", "name"] }, bool: { must: { term: { status: 1 } }, should: [], minimum_should_match: 1 } } })
Error:
"fields\":[\"winery\",\"name\"]},\"bool\":{\"must\":{\"term\":{\"status\":1}},\"should\":[],\"minimum_should_match\":1}}}]]]; nested: ElasticsearchParseException[Expected field name but got START_OBJECT \"bool\"]; }]","status":400}
What is wrong with the request? How to execute multi_match and BOOL together?
source share