<p dir="auto">Now that PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="35792428" data-permission-text="Title is private" data-url="https://github.com/elastic/elasticsearch/issues/6511" data-hovercard-type="pull_request" data-hovercard-url="/elastic/elasticsearch/pull/6511/hovercard" href="https://github.com/elastic/elasticsearch/pull/6511">#6511</a> has been merged, self referential parent/child support is explicitly disabled. Self referential parent/child was never explicitly supported. It wasn't documented and no tests existed for this parent/child use case. A long time ago it used to work, but since 0.90 self referential parent/child has not been working correctly. See <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="40732496" data-permission-text="Title is private" data-url="https://github.com/elastic/elasticsearch/issues/7357" data-hovercard-type="issue" data-hovercard-url="/elastic/elasticsearch/issues/7357/hovercard" href="https://github.com/elastic/elasticsearch/issues/7357">#7357</a>.</p>
<p dir="auto">Right now we need to know what is a parent document and what is a child document. We do this via the <code class="notranslate">_type</code> field. The issue with self referential parent child is that we use the same type for both parent and child document and therefore we can't distinguish between parent and child document.</p>
<p dir="auto">I think we can get around this issue by using the fact if a document has a <code class="notranslate">_parent</code> field instead of the <code class="notranslate">type</code> field for identification. I think this works okay for single level relationships (a parent type and a child type), but for multi level relationships (a parent type, child type and grandchild type) I don't think this works out as what is requested in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="45901510" data-permission-text="Title is private" data-url="https://github.com/elastic/elasticsearch/issues/8100" data-hovercard-type="issue" data-hovercard-url="/elastic/elasticsearch/issues/8100/hovercard" href="https://github.com/elastic/elasticsearch/issues/8100">#8100</a>.</p>
<p dir="auto">Users can provide various intervals for the date histogram but application code doesn't know which interval was chosen at query time. Knowing this is particularly useful when building client-side visualizations where an axis is required or labels need to be generated.</p>