For example, with this document:
{
"object": [{
"myField": 1
},
{
"myField": 1
}]
}
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. |