Skip to content

geo_shape query/filter: indexed_shape has no syntax to define _routing value and throws RoutingMissingException, because _routing undefined #7663

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

Closed
helllamer opened this issue Sep 9, 2014 · 4 comments
Assignees
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes >bug good first issue low hanging fruit help wanted adoptme

Comments

@helllamer
Copy link

Currently, GeoShape filter and query supports to pre-indexed shape as argument[1].
But, there are no way to define required _routing value for pre-indexed shape. This causes RoutingMissingException if routing is mandatory.

elasticsearch version 1.3.2

For example, mapping is:

curl -XPOST 'localhost:9200/-inx/ang/_mapping' -d'{
  "ang" : {
    "_parent" : {
      "type" : "someType"
    },
    "_routing" : {
      "required" : true
    },
    "properties" : {
      "to" : {
        "type" : "geo_shape",
        "tree_levels" : 6
      }
    }
  }
}'

Add some data:

curl -XPUT 'localhost:9200/-inx/ang/ouX6eeH5RxKQG3vJ5Ho84A?parent=111' -d '{
    "to" : {
        "type" : "circle",
        "coordinates" : [-45.0, 45.0],
        "radius" : "100m"
    }
}'

Let's make a query:

curl -XGET 'localhost:9200/_search' -d'{
  "query" : {
    "geo_shape" : {
      "to" : {
        "indexed_shape" : {
          "type" : "ang",
          "index" : "-inx",
          "path" : "to",
          "id" : "ouX6eeH5RxKQG3vJ5Ho84A"
        }
      }
    }
  }
}'
org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to execute phase [query_fetch], all shards failed; shardFailures {[eryGHbZWSMa-YJiCpgVbcg][-inx][0]: 
RemoteTransportException[[Alistair Smythe][inet[/127.0.0.1:9300]][search/phase/query+fetch]]; nested: SearchParseException[[-inx][0]: from[0],size[10]:
Parse Failure [Failed to parse source [{"query":{"geo_shape":{"to":{"indexed_shape":{"id":"ouX6eeH5RxKQG3vJ5Ho84A","type":"ang","index":"-inx","path":"to"}}}}}]]];
nested: RoutingMissingException[routing is required for [-inx]/[ang]/[ouX6eeH5RxKQG3vJ5Ho84A]]; }
        at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:233) ~[elasticsearch-1.3.2.jar:na]
        at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$1.onFailure(TransportSearchTypeAction.java:179) ~[elasticsearch-1.3.2.jar:na]
        at org.elasticsearch.search.action.SearchServiceTransportAction$12.handleException(SearchServiceTransportAction.java:326) ~[elasticsearch-1.3.2.jar:na]
        at org.elasticsearch.transport.netty.MessageChannelHandler.handleException(MessageChannelHandler.java:185) ~[elasticsearch-1.3.2.jar:na]
        at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:175) ~[elasticsearch-1.3.2.jar:na]

[1] http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-geo-shape-filter.html#_pre_indexed_shape

@clintongormley
Copy link
Contributor

thanks for reporting @helllamer

@clintongormley clintongormley added the :Analytics/Geo Indexing, search aggregations of geo points and shapes label Nov 10, 2014
helllamer added a commit to suggestio/elasticsearch that referenced this issue Jan 16, 2015
@helllamer
Copy link
Author

I've rebased and squashed all 3 commits against current master: 4271835

Github automatically blocked my #7667, so I cannot comment it.

@nknize nknize added v1.4.4 and removed v1.4.3 labels Feb 5, 2015
@spinscale spinscale added v1.4.5 and removed v1.4.4 labels Feb 19, 2015
@s1monw s1monw added v1.6.0 and removed v1.5.0 labels Mar 17, 2015
@clintongormley
Copy link
Contributor

Hi @helllamer

Apologies - I've just seen your comment about having rebased your commit... from months ago! Sorry, please could you open it as a new PR, otherwise we'll never see it :)

thanks

@clintongormley
Copy link
Contributor

Assigning to @nknize as this is still an issue

@clintongormley clintongormley removed the help wanted adoptme label Nov 21, 2015
@spinscale spinscale added v2.3.0 and removed v2.2.0 labels Dec 23, 2015
@clintongormley clintongormley added help wanted adoptme and removed v2.4.3 labels Nov 25, 2016
@imotov imotov assigned imotov and unassigned nknize May 16, 2018
imotov added a commit to imotov/elasticsearch that referenced this issue May 21, 2018
Adds ability to specify the routing value for the indexed shape in the
geo_shape query.

Closes elastic#7663
imotov added a commit that referenced this issue May 23, 2018
Adds ability to specify the routing value for the indexed shape in the
geo_shape query.

Closes #7663
imotov added a commit that referenced this issue May 23, 2018
Adds ability to specify the routing value for the indexed shape in the
geo_shape query.

Closes #7663
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 good first issue low hanging fruit help wanted adoptme
Projects
None yet
Development

No branches or pull requests

7 participants