Elasticsearch aggregations return the count of nested (leaf) documents

Description

For example, with this document:

If we run a "terms" aggregation on field "object.myField":

  • If "object" is flattened, the document will contribute for 1 in the count of documents with value "1".

  • If "object" is nested, the document will contribute for 2 in the count of documents with value "1".

One would expect the document to count as one in either case, since users don't specify nesting explicitly when they define aggregations: it's all just inferred and added automatically.

Environment

None

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Priority

Major
Configure