Skip to content

Conversation

danielmitterdorfer
Copy link
Member

Originally, only numeric values were allowed for parameters of the
'geohash_grid' aggregation in contrast to other places in the REST
API.

With this commit we also allow that parameters are enclosed in quotes (i.e.
as JSON strings). Additionally, with this commit the valid range for
'precision' is enforced for the Java API and the REST API (the latter was
previously missing the check).

Closes #13132

@danielmitterdorfer danielmitterdorfer added >bug :Analytics/Geo Indexing, search aggregations of geo points and shapes review labels Nov 2, 2015
@danielmitterdorfer
Copy link
Member Author

Can you please have a look @markharwood, @jpountz? The PR basically allows to quote parameters of the geohash_grid aggregation and enforces the documented range of [1,12] for precision as stated in the docs. You can find an example for reproduction in the corresponding ticket #13132.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to find the '==false' way easier to read

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am used to the !x notation but I am ok with reverting that.

@jpountz
Copy link
Contributor

jpountz commented Nov 3, 2015

Thanks @danielmitterdorfer I left some comments. You might want to coordinate with @colings86 on this since he has an open PR to refactor this aggregation to parse on the coordinating node (#14138).

@danielmitterdorfer
Copy link
Member Author

Thanks for the heads up on @colings86 work. I'll check with him. @jpountz: Can you look again at my changes?

@jpountz
Copy link
Contributor

jpountz commented Nov 3, 2015

The PR looks good to me now, thanks!

@danielmitterdorfer
Copy link
Member Author

Ok, I'll check next with @colings86 on how to proceed regarding #14138.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just use parser.isValue() here instead? I think we do this in other places that we are coercing the value into a number

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot use #isValue() here because it would also return true on other types such as booleans which we want to exclude.

@colings86
Copy link
Contributor

LGTM

…ggregation

Originally, only numeric values were allowed for parameters of the
'geohash_grid' aggregation in contrast to other places in the REST
API.

With this commit we also allow that parameters are enclosed in quotes (i.e.
as JSON strings). Additionally, with this commit the valid range for
'precision' is enforced for the Java API and the REST API (the latter was
previously missing the check).

Closes elastic#13132
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/Geo Indexing, search aggregations of geo points and shapes >bug v2.1.0 v2.2.0 v5.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent handling of string numerics in geo aggregation "precision" parameter

3 participants