parent
c7bcb32ae6
commit
0ce88b5887
|
@ -110,7 +110,7 @@ GET my_index/_search
|
|||
"bool": {
|
||||
"must": [
|
||||
{ "match": { "user.first": "Alice" }},
|
||||
{ "match": { "user.last": "White" }} <2>
|
||||
{ "match": { "user.last": "Smith" }} <2>
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ GET my_index/_search
|
|||
"bool": {
|
||||
"must": [
|
||||
{ "match": { "user.first": "Alice" }},
|
||||
{ "match": { "user.last": "Smith" }} <3>
|
||||
{ "match": { "user.last": "White" }} <3>
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -137,14 +137,14 @@ GET my_index/_search
|
|||
"user.first": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// AUTOSENSE
|
||||
<1> The `user` field is mapped as type `nested` instead of type `object`.
|
||||
<2> This query doesn't match because `Alice` and `White` are not in the same nested object.
|
||||
<2> This query doesn't match because `Alice` and `Smith` are not in the same nested object.
|
||||
<3> This query matches because `Alice` and `White` are in the same nested object.
|
||||
<4> `inner_hits` allow us to highlight the matching nested documents.
|
||||
|
||||
|
|
Loading…
Reference in New Issue