Skip to content

Commit

Permalink
Docs: Parent field is no longer indexed and should use parent_id inst…
Browse files Browse the repository at this point in the history
…ead of term query

Closes #22517
  • Loading branch information
clintongormley committed Jan 10, 2017
1 parent 13fe601 commit 5d55063
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions docs/reference/mapping/fields/parent-field.asciidoc
Expand Up @@ -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": {
Expand All @@ -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

Expand Down

0 comments on commit 5d55063

Please sign in to comment.