diff --git a/docs/reference/query-dsl/filters/has-child-filter.asciidoc b/docs/reference/query-dsl/filters/has-child-filter.asciidoc index 2815ad45b80..360feb021c3 100644 --- a/docs/reference/query-dsl/filters/has-child-filter.asciidoc +++ b/docs/reference/query-dsl/filters/has-child-filter.asciidoc @@ -75,13 +75,24 @@ is specified. [float] ==== Memory Considerations -With the current implementation, all `_parent` field values and all `_id` -field values of parent documents are loaded into memory (heap) via field data -in order to support fast lookups, so make sure there is enough memory for it. +In order to support parent-child joins, all of the (string) parent IDs +must be resident in memory (in the <>. +Additionaly, every child document is mapped to its parent using a long +value (approximately). It is advisable to keep the string parent ID short +in order to reduce memory usage. + +You can check how much memory is being used by the ID cache using the +<> or <> +APIS, eg: + +[source,js] +-------------------------------------------------- +curl -XGET "http://localhost:9200/_stats/id_cache?pretty&human" +-------------------------------------------------- [float] ==== Caching The `has_child` filter cannot be cached in the filter cache. The `_cache` and `_cache_key` options are a no-op in this filter. Also any filter that -wraps the `has_child` filter either directly or indirectly will not be cached. \ No newline at end of file +wraps the `has_child` filter either directly or indirectly will not be cached. diff --git a/docs/reference/query-dsl/filters/has-parent-filter.asciidoc b/docs/reference/query-dsl/filters/has-parent-filter.asciidoc index 3bd4c597087..345e69258bc 100644 --- a/docs/reference/query-dsl/filters/has-parent-filter.asciidoc +++ b/docs/reference/query-dsl/filters/has-parent-filter.asciidoc @@ -46,11 +46,22 @@ The `has_parent` filter also accepts a filter instead of a query: -------------------------------------------------- [float] -==== Memory considerations +==== Memory Considerations -With the current implementation, all `_parent` field values and all `_id` -field values of parent documents are loaded into memory (heap) via field data -in order to support fast lookups, so make sure there is enough memory for it. +In order to support parent-child joins, all of the (string) parent IDs +must be resident in memory (in the <>. +Additionaly, every child document is mapped to its parent using a long +value (approximately). It is advisable to keep the string parent ID short +in order to reduce memory usage. + +You can check how much memory is being used by the ID cache using the +<> or <> +APIS, eg: + +[source,js] +-------------------------------------------------- +curl -XGET "http://localhost:9200/_stats/id_cache?pretty&human" +-------------------------------------------------- [float] ==== Caching diff --git a/docs/reference/query-dsl/queries/has-child-query.asciidoc b/docs/reference/query-dsl/queries/has-child-query.asciidoc index 9cae07e9e92..c0a493c04ce 100644 --- a/docs/reference/query-dsl/queries/has-child-query.asciidoc +++ b/docs/reference/query-dsl/queries/has-child-query.asciidoc @@ -86,6 +86,19 @@ the `score_mode` parameter. [float] ==== Memory Considerations -With the current implementation, all `_parent` field values and all `_id` -field values of parent documents are loaded into memory (heap) via field data -in order to support fast lookups, so make sure there is enough memory for it. +In order to support parent-child joins, all of the (string) parent IDs +must be resident in memory (in the <>. +Additionaly, every child document is mapped to its parent using a long +value (approximately). It is advisable to keep the string parent ID short +in order to reduce memory usage. + +You can check how much memory is being used by the ID cache using the +<> or <> +APIS, eg: + +[source,js] +-------------------------------------------------- +curl -XGET "http://localhost:9200/_stats/id_cache?pretty&human" +-------------------------------------------------- + + diff --git a/docs/reference/query-dsl/queries/has-parent-query.asciidoc b/docs/reference/query-dsl/queries/has-parent-query.asciidoc index cfaf9f1be58..f684173a45b 100644 --- a/docs/reference/query-dsl/queries/has-parent-query.asciidoc +++ b/docs/reference/query-dsl/queries/has-parent-query.asciidoc @@ -52,6 +52,19 @@ matching parent document. The score type can be specified with the [float] ==== Memory Considerations -With the current implementation, all `_parent` field values and all `_id` -field values of parent documents are loaded into memory (heap) via field data -in order to support fast lookups, so make sure there is enough memory for it. +In order to support parent-child joins, all of the (string) parent IDs +must be resident in memory (in the <>. +Additionaly, every child document is mapped to its parent using a long +value (approximately). It is advisable to keep the string parent ID short +in order to reduce memory usage. + +You can check how much memory is being used by the ID cache using the +<> or <> +APIS, eg: + +[source,js] +-------------------------------------------------- +curl -XGET "http://localhost:9200/_stats/id_cache?pretty&human" +-------------------------------------------------- + + diff --git a/docs/reference/query-dsl/queries/top-children-query.asciidoc b/docs/reference/query-dsl/queries/top-children-query.asciidoc index f3d26dff27d..726fa8f9ee3 100644 --- a/docs/reference/query-dsl/queries/top-children-query.asciidoc +++ b/docs/reference/query-dsl/queries/top-children-query.asciidoc @@ -66,6 +66,19 @@ same scope name that will work against the child documents. For example: [float] ==== Memory Considerations -With the current implementation, all `_parent` field values and all `_id` -field values of parent documents are loaded into memory (heap) via field data -in order to support fast lookups, so make sure there is enough memory for it. +In order to support parent-child joins, all of the (string) parent IDs +must be resident in memory (in the <>. +Additionaly, every child document is mapped to its parent using a long +value (approximately). It is advisable to keep the string parent ID short +in order to reduce memory usage. + +You can check how much memory is being used by the ID cache using the +<> or <> +APIS, eg: + +[source,js] +-------------------------------------------------- +curl -XGET "http://localhost:9200/_stats/id_cache?pretty&human" +-------------------------------------------------- + +