Docs: Parent field is no longer indexed and should use parent_id instead of term query

Closes #22517
This commit is contained in:
Clinton Gormley 2017-01-10 13:48:07 +01:00
parent 6e1df967be
commit cb7952e71d
1 changed files with 7 additions and 5 deletions

View File

@ -59,16 +59,18 @@ See the <<query-dsl-has-child-query,`has_child`>> and
the <<search-aggregations-bucket-children-aggregation,`children`>> aggregation,
and <<parent-child-inner-hits,inner hits>> for more information.
The value of the `_parent` field is accessible in queries, aggregations,
and scripts:
The value of the `_parent` field is accessible in aggregations
and scripts, and may be queried with the
<<query-dsl-parent-id-query, `parent_id` query>>:
[source,js]
--------------------------
GET my_index/_search
{
"query": {
"terms": {
"_parent": [ "1" ] <1>
"parent_id": { <1>
"type": "my_parent",
"id": "1"
}
},
"aggs": {
@ -92,7 +94,7 @@ GET my_index/_search
// CONSOLE
// TEST[continued]
<1> Querying on the `_parent` field (also see the <<query-dsl-has-parent-query,`has_parent` query>> and the <<query-dsl-has-child-query,`has_child` query>>)
<1> Querying the id of the `_parent` field (also see the <<query-dsl-has-parent-query,`has_parent` query>> and the <<query-dsl-has-child-query,`has_child` query>>)
<2> Aggregating on the `_parent` field (also see the <<search-aggregations-bucket-children-aggregation,`children`>> aggregation)
<3> Accessing the `_parent` field in scripts