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

renaming files in a directory using python or R -

html - outline-style different in chrome compared to firefox and internet explorer -

ruby on rails - Carrierwave Timeout -