-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add parsing for InternalAdjacencyMatrix aggregation #24700
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
Add parsing for InternalAdjacencyMatrix aggregation #24700
Conversation
javanna
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a small comment, LGTM otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a typo in the name: rename to ParsedAdjacencyMatrix ?
tlrx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I left some comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can use the ParsedMultiBucketAggregation.ParsedBucket#toXContent() method and not declare it here again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right, although this has the potential to render a keyed response or the key_as_string field if this class is not used correctly, but I guess its worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could use
return parseXContent(parser, false, ParsedBucket::new, (p, bucket) -> bucket.key = p.text());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, again I used a modified method here to not parse a.g. KEY_AS_STRING but I think its worth the saving to just reuse the more general super class method since we know the response doesn't contain certain fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree too
871f722 to
5a4d757
Compare
This adds parsing and related tests to the InternalAdjacencyMatrix aggregation.
Based on #24698 which should go into master first.