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 -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -