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: Geo-distance without distance throws an NPE #7260

Closed
clintongormley opened this issue Aug 13, 2014 · 0 comments

Comments

@clintongormley
Copy link
Member

commented Aug 13, 2014

GET /attractions/restaurant/_search
{
  "query": {
    "filtered": {
      "filter": {
        "geo_distance": {
        "location": {
          "lat": 40.715,
          "lon": -73.998
        }
        }
      }
    }
  }
}

NPE:

Caused by: java.lang.NullPointerException
at org.elasticsearch.common.unit.DistanceUnit$Distance.parseDistance(DistanceUnit.java:319)
at org.elasticsearch.common.unit.DistanceUnit$Distance.access$000(DistanceUnit.java:245)
at org.elasticsearch.common.unit.DistanceUnit.parse(DistanceUnit.java:162)
at org.elasticsearch.index.query.GeoDistanceFilterParser.parse(GeoDistanceFilterParser.java:147)
at org.elasticsearch.index.query.QueryParseContext.executeFilterParser(QueryParseContext.java:290)
at org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:271)
at org.elasticsearch.index.query.FilteredQueryParser.parse(FilteredQueryParser.java:74)
at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:234)
at org.elasticsearch.index.query.IndexQueryParserService.innerParse(IndexQueryParserService.java:342)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:268)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:263)
at org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:669)
... 9 more
@clintongormley clintongormley added the bug label Aug 13, 2014
@colings86 colings86 changed the title Geo-distance without distance throws an NPE Geo: Geo-distance without distance throws an NPE Aug 14, 2014
@colings86 colings86 closed this in 7602b13 Aug 14, 2014
colings86 added a commit that referenced this issue Aug 14, 2014
geo_distance filter now throws a parse exception if no distance parameter is supplied

Close #7260
colings86 added a commit that referenced this issue Sep 8, 2014
geo_distance filter now throws a parse exception if no distance parameter is supplied

Close #7260
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.