GET bank/_search { "query": { "bool": { "must": [ {"match": {"gender": "m"}}, {"match": {"address": "mill"}} ], "must_not": [ {"match": {"age": "18"}} ], "should": [ {"match": {"lastname": "Wallace"}} ], "filter": { "range": { "age": { "gte": 18, "lte": 35 } } } } } } GET /bank/_search { "query": { "bool": { "must": [ { "match": { "gender": "m" } }, { "match": { "address": "mill" } } ], "must_not": [ { "match": { "age": "18" } } ], "should": [ { "match": { "lastname": "Wallace" } } ] } } }
GET bank/_search
{
"query": {
"bool": {
"must": [
{"match": {"gender": "m"}},
{"match": {"address": "mill"}}
],
"must_not": [
{"match": {"age": "18"}}
],
"should": [
{"match": {"lastname": "Wallace"}}
],
"filter": {
"range": {
"age": {
"gte": 18,
"lte": 35
}
}
}
}
}
}GET /bank/_search
{
"query": {
"bool": {
"must": [
{ "match": { "gender": "m" } },
{ "match": { "address": "mill" } }
],
"must_not": [
{ "match": { "age": "18" } }
],
"should": [
{ "match": { "lastname": "Wallace" } }
]
}
}
}
{ "took" : 1, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : { "value" : 1, "relation" : "eq" }, "max_score" : 12.585751, "hits" : [ { "_index" : "bank", "_type" : "account", "_id" : "970", "_score" : 12.585751, "_source" : { "account_number" : 970, "balance" : 19648, "firstname" : "Forbes", "lastname" : "Wallace", "age" : 28, "gender" : "M", "address" : "990 Mill Road", "employer" : "Pheast", "email" : "forbeswallace@pheast.com", "city" : "Lopezo", "state" : "AK" } } ] } }
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : 12.585751,
"hits" : [
{
"_index" : "bank",
"_type" : "account",
"_id" : "970",
"_score" : 12.585751,
"_source" : {
"account_number" : 970,
"balance" : 19648,
"firstname" : "Forbes",
"lastname" : "Wallace",
"age" : 28,
"gender" : "M",
"address" : "990 Mill Road",
"employer" : "Pheast",
"email" : "forbeswallace@pheast.com",
"city" : "Lopezo",
"state" : "AK"
}
}
]
}
}