-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
Elasticsearch server version: {"number": "5.6.6","lucene_version": "6.6.1"}
Elasticsearch client version: 6.2.1
Plugins installed: [{ "name": "x-pack", "version": "5.6.6", "description": "Elasticsearch Expanded Pack Plugin", "classname": "org.elasticsearch.xpack.XPackPlugin", "has_native_controller": true }]
JVM version: 1.8.0_151
OS version: Linux ubuntu 4.4.0-116-generic
Description of the problem including expected versus actual behavior:
When I include a geo distance query into the should clause of my master bool query and use this query to search for results, it would produce a java.io.IOException: Unknown GeoDistance ordinal [2]
Expected: search to return with correct results. Actual: search produces an IOException.
Notes & Observations:
- The master bool query also contains other queries in its other clauses. However, the search with the same parameters works when the geo distance query is excluded.
- The search is successful if I manually copy the master bool query string and paste it into my ElasticSearch Head browser plugin (and also curl I'm assuming).
Steps to reproduce:
BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery();
queryBuilder.should(
QueryBuilders.geoDistanceQuery(term).point(origin).distance(distance)
);
client.prepareSearch(index)
.setTypes(type)
.setFrom(from)
.setSize(size)
.setQuery(queryBuilder);Stack trace:
java.io.IOException Unknown GeoDistance ordinal [2].txt