Skip to content
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

Enable geo_distance and geo_bounding_box queries on geo_shape field type #54628

Closed
iverase opened this issue Apr 2, 2020 · 9 comments · Fixed by #64224
Closed

Enable geo_distance and geo_bounding_box queries on geo_shape field type #54628

iverase opened this issue Apr 2, 2020 · 9 comments · Fixed by #64224
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@iverase
Copy link
Contributor

iverase commented Apr 2, 2020

Following the development in #48928, we should enable geo_distance and geo_bounding_box queries over geo_shape field type.

@iverase iverase added >enhancement :Analytics/Geo Indexing, search aggregations of geo points and shapes labels Apr 2, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (:Analytics/Geo)

@hariseldon3141
Copy link

hariseldon3141 commented Apr 4, 2020

@iverase Excuse my ignorance, but how does this differ from #53466

@iverase
Copy link
Contributor Author

iverase commented Apr 6, 2020

@hariseldon3141 no problem as I can see where your confusion is coming from.

The only query supported by geo_shape field is currently the geo_shape query. In #53466 we added the capability of building geo distance queries on geo shape fields when using the current default indexing strategy which means that you can now build a geo_shape query using a CIRCLE shape (see #39237).

In this change we proposed to be able to run geo_distance and geo_boulding_box queries over geo_shape fields as it currently only supports being executed over a geo_point field.

@Shubhangi2901
Copy link

Hi @iverase I would like to work on this issue

@iverase
Copy link
Contributor Author

iverase commented Apr 8, 2020

Hi @Shubhangi2901,

great, please feel free to open a PR addressing the issue.

Thanks!

@Shubhangi2901
Copy link

Hi @iverase - Can you give me a little bit more context on what exactly needs be done for this issue?

I went over the code for geo_boundingbox queries and geo_distance queries and geo_shape field type and understand it, but now given a geo_shape field type, how am I expected to use the geo_distance concepts for it? I can think of a few ways which I am not sure are correct, but I am not sure if you already have thoughts on how you'd like this to be implemented.

@iverase
Copy link
Contributor Author

iverase commented Apr 27, 2020

Hi,

I will try :)

First of all, mind you that last week there was a bit of refactoring going on in geo field mappers (#55621). Now geo_point and geo_shape inherit from AbstractGeometryFieldMapper, which defines an AbstractGeometryFieldType which can generate geometry queries.

The idea for geo_distance and geo_bounding_box queries is to accept any field that is an instance of AbstractGeometryFieldMapper. In that case, we can build the query as a geometry query as defined in the interface. We are already doing something very similar in geo_shape queries:

if (validContentTypes().contains(fieldType.typeName()) == false) {

hope it makes sense.

@rjernst rjernst added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label May 4, 2020
@iverase
Copy link
Contributor Author

iverase commented Jun 12, 2020

Hi @Shubhangi2901,

Do you have any update about this issue? Are you still working on it?

Thanks!

@Shubhangi2901
Copy link

Hi @iverase

Sorry for not updating earlier - I was busy with a couple of other things that were taking precedence.

I have made some progress on this issue now, and I am sharing a link to my PR with the initial progress on this issue:
#58151

I describe what have I done till now in the PR, please take a look and let me know if I am on the right track - I'm figuring out next steps and will add more commits my PR soon.

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 >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants