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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -