Matching multiple attribs with elasticsearch -
so have bunch of records {a: x, b: y}
.
i construct search query match both a
, b
attrib.
however, adding 1 more criteria match
, query fail parse.
this works.
{ "query" : { "match": { "a": "x" } } }
this doesn't.
{ "query" : { "match": { "a": "x", "b": "y" } } }
it should this:
{ "query": { "bool": { "must": [ { "match": {"a": "x"} }, { "match": {"b": "y"} } ] } } }
use must
and
match clauses, use should
or
match clauses.
Comments
Post a Comment