Elasticsearch | Match multiple phrases
ANSWER:
{ "query": { "bool": { "should": [ { "match": { "message": { "query": "breaking bad", "type": "phrase" } } }, { "match": { "message": "#poznasty" } } ] } }}
why not use multi_match
{ "query" : { "multi_match" : { "fields" : ["name", "description"], "query" : "breaking bad", "type" : "phrase_prefix" } }}MultiMatchQueryBuilder builder = QueryBuilders.multiMatchQuery(query, "name", "description").type(MatchQueryBuilder.Type.PHRASE_PREFIX);