-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add parsing for InternalGeoCentroid #24371
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 InternalGeoCentroid #24371
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.
LGTM
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.
out of curiosity: do we have similar shared methods for toXContent in some other place? not a huge deal but I am a bit on the fence on adding these. Ideally the two impls wouldn't depend on each other and one day will be split apart. On the other hand we can ignore this and fix it later when needed.
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.
No, we don't. I tried this in one PR by sharing something similar in the interface but that isn't such a good solution either. In former cases the two toXContent were slightliy different, in this case they are really similar, thats why I didn't want to copy them. But I get the point about dependencies and can copy the toXContent over if you prefer.
One other note on this: we often share ParseFields or at least the field keys between InternalX and ParsedX, should we also already start pulling them out, e.g. into the interfaces? Maybe better later when we eventually do the splitting at some point in the future?
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.
Good point about the parse fields. Let's not worry too much for now. We can't be consistent if we don't enforce these constraints. Let's share these simple things for now and one day we will change that when we need to.
3149ad3 to
a22d0bc
Compare
cbuescher
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.
@javanna thanks, I reverted the shared xContent rendering and will merge this to the feature branch with the added count field in InternalGeoCentroid. I will also open an issue that we merge this part to master individually.
|
@cbuescher your call I am fine either way. |
49c36da to
7759506
Compare
7759506 to
d50961e
Compare
This adds parsing to the InternalGeoCentroid aggregation. One problem I encountered here is that we don't render the
countparameter that is available through thecount()method in the GeoCentroid interface to REST (see #24366). After discussing this it looks like we should add this parameter to the REST output of the aggregation. I did this in this PR already but I think I will also open a separate PR to do this in master already.I'm not sure we can do anything in 5.x if we backport, we will need to work with a dummy constant for the
countvalue there since it is not available via REST.