New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deeply nested aggregations treated like unnested document aggregations #9280
Comments
The mapping seems to be wrong in the above (it doesn't parse) I think it should be:
|
Also, this issue doesn't seem to reproduce on the current master branch |
@colings86 @pickypg I think I found the bug. The But this isn't the case if buckets are introduced during executing of aggs. If buckets are created before the actual execution this assumption is true. This results in the parent filter not being resolved correctly for nested I'll open a pr and move the resolving of the parentFilter to the collect method instead, in that method we can assume that the child filter of a parent nested aggregator is resolved at that time, which can than be as a parent filter for the nested aggregator that are nested below. |
…y in the case the nested agg gets created on the fly for buckets that are constructed during query execution. The fix is the move the parent filter resolving from the nextReader(...) method to the collect(...) method, because only then any parent nested filter's parent filter is then properly instantiated. Closes elastic#9280 Closes elastic#9335
…y in the case the nested agg gets created on the fly for buckets that are constructed during query execution. The fix is the move the parent filter resolving from the nextReader(...) method to the collect(...) method, because only then any parent nested filter's parent filter is then properly instantiated. Closes elastic#9280 Closes elastic#9335
…y in the case the nested agg gets created on the fly for buckets that are constructed during query execution. The fix is the move the parent filter resolving from the nextReader(...) method to the collect(...) method, because only then any parent nested filter's parent filter is then properly instantiated. Closes #9280 Closes #9335
…y in the case the nested agg gets created on the fly for buckets that are constructed during query execution. The fix is the move the parent filter resolving from the nextReader(...) method to the collect(...) method, because only then any parent nested filter's parent filter is then properly instantiated. Closes #9280 Closes #9335
…y in the case the nested agg gets created on the fly for buckets that are constructed during query execution. The fix is the move the parent filter resolving from the nextReader(...) method to the collect(...) method, because only then any parent nested filter's parent filter is then properly instantiated. Closes elastic#9280 Closes elastic#9335
…y in the case the nested agg gets created on the fly for buckets that are constructed during query execution. The fix is the move the parent filter resolving from the nextReader(...) method to the collect(...) method, because only then any parent nested filter's parent filter is then properly instantiated. Closes elastic#9280 Closes elastic#9335
Given this "small" example, you can create the mapping, index two simple documents, and aggregate against it. This was tested on 1.4.2 (and internally reported on 1.3.1).
The mapping defines two nested objects -- one within the other (
comments
andcomments.tags
). Thedates
object just contains some queried and basic aggregated details.The data is setup so that it should be immediately obvious if it's wrong or not. Each comment is given a unique ID with
comments.cid
(1, 2, 3, and 4). Only the odd-numbered (1 and 3) comments have tags added to them. The even-numbered (2 and 4) comments have acomments.identifier
meant to be found in the aggregation. The tags are given unique IDs that reflect their parent comment withcomments.tags.tid
(22 and 44; extended versions of cid just to be unique to avoid confusion).There are two nested aggregations toward the bottom of the aggregation, and the inner one is unexpectedly passed the tag associated with
comments.cid
of2
even though that comment does not match parent aggregations (as evidenced by printouts on the command line seen after the setup)!The scripts exist to verify steps along the way, but this prints out (on the ES node's command line):
Since
Comment Map: [2]\nID: 2
never appeared in the output, there is no reason that the Tag should have been processed!What's more baffling is that you can remove the top two aggregations and it will execute properly:
Prints out
Without improperly finding any tags.
EDITED: I fixed the mapping, which must have been copy/pasted wrong.
The text was updated successfully, but these errors were encountered: