PUT my_index/_doc/1 { "group": "fans", "users": [ { "first": "Jack", "last": "Smith" }, { "first": "Rose", "last": "White" } ] } GET my_index/_search { "query": { "bool": { "must": [ { "match": { "users.first": "Jack" } }, { "match": { "users.last": "White" } } ] } } }
PUT my_index/_doc/1
{
"group": "fans",
"users": [
{
"first": "Jack",
"last": "Smith"
},
{
"first": "Rose",
"last": "White"
}
]
}GET my_index/_search
{
"query": {
"bool": {
"must": [
{
"match": {
"users.first": "Jack"
}
},
{
"match": {
"users.last": "White"
}
}
]
}
}
}
{ "took" : 1, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : { "value" : 1, "relation" : "eq" }, "max_score" : 0.5753642, "hits" : [ { "_index" : "my_index", "_type" : "_doc", "_id" : "1", "_score" : 0.5753642, "_source" : { "group" : "fans", "users" : [ { "first" : "Jack", "last" : "Smith" }, { "first" : "Rose", "last" : "White" } ] } } ] } }
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : 0.5753642,
"hits" : [
{
"_index" : "my_index",
"_type" : "_doc",
"_id" : "1",
"_score" : 0.5753642,
"_source" : {
"group" : "fans",
"users" : [
{
"first" : "Jack",
"last" : "Smith"
},
{
"first" : "Rose",
"last" : "White"
}
]
}
}
]
}
}