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

geo_shape query with circle does not work for legacy geo_shape field #49296

Closed
iverase opened this issue Nov 19, 2019 · 7 comments · Fixed by #49410
Closed

geo_shape query with circle does not work for legacy geo_shape field #49296

iverase opened this issue Nov 19, 2019 · 7 comments · Fixed by #49410
Assignees
Labels

Comments

@iverase
Copy link
Contributor

iverase commented Nov 19, 2019

We currently do not support circle queries for geo_shape fields using BKD_backed geo_shape but it should be possible to do it using legacy indexing strategy.

This is currently broken. They issue seems to be in the serialisation mechanism which throws an error for circle geometries.

@iverase iverase added >bug :Analytics/Geo Indexing, search aggregations of geo points and shapes v8.0.0 v7.4.0 v7.5.0 v7.4.1 v7.6.0 v7.4.2 labels Nov 19, 2019
@elasticmachine
Copy link
Collaborator

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

@imotov imotov self-assigned this Nov 19, 2019
@imotov
Copy link
Contributor

imotov commented Nov 20, 2019

I started to look into it, and implemented serialization, but then I realized that we didn't support circles in queries for a very long time (if ever) I went all the way back to v2.4.6 and we didn't support circle queries even back then. So, it's not just a serialization issue. Considering that we are trying to deprecate and remove the legacy index strategy, I am not totally sure it's worth the effort to add it there. I think we should discuss it before I sink more time into it.

@iverase
Copy link
Contributor Author

iverase commented Nov 20, 2019

Circles queries are supported for LegacyGeoShape (aka prefix trees). I think this needs to be fixed.

@imotov
Copy link
Contributor

imotov commented Nov 20, 2019

It doesn't look like there is support on the elasticsearch side.

@iverase
Copy link
Contributor Author

iverase commented Nov 20, 2019

@imotov
Copy link
Contributor

imotov commented Nov 20, 2019

Reproduction:

DELETE test
PUT test
{
  "mappings": {
    "doc": {
      "properties": {
        "location": {
          "type": "geo_shape",
          "tree": "geohash",
          "strategy": "recursive"
        }
      }
    }
  }
}

PUT test/doc/1
{
  "location": {
    "type": "circle",
    "coordinates": [10, 20],
    "radius": "100m"
  }
}

POST test/doc/_search
{
  "query": {
    "geo_shape": {
      "location": {
        "shape": {
          "type": "circle",
          "coordinates": [
            10,
            20
          ],
          "radius": "100m"
        }
      }
    }
  }
}

imotov added a commit to imotov/elasticsearch that referenced this issue Nov 20, 2019
Brings back support for circles in legacy geo_shape queries that
was accidentally lost during query refactoring.

Fixes elastic#49296
@imotov
Copy link
Contributor

imotov commented Nov 21, 2019

Just to clarify. I was looking at the wrong place. We did indeed support it, but I lost it during refactoring in 7.4.0. I opened PR that restores this functionality.

imotov added a commit that referenced this issue Nov 21, 2019
Brings back support for circles in legacy geo_shape queries that
was accidentally lost during query refactoring.

Fixes #49296
imotov added a commit that referenced this issue Nov 21, 2019
Brings back support for circles in legacy geo_shape queries that
was accidentally lost during query refactoring.

Fixes #49296
imotov added a commit that referenced this issue Nov 21, 2019
Brings back support for circles in legacy geo_shape queries that
was accidentally lost during query refactoring.

Fixes #49296
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants