Docs: Parent field is no longer indexed and should use parent_id instead of term query
Closes
@@ -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
