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

IOException: Unknown GeoDistance ordinal [2] #29301

Closed
mloho opened this issue Mar 29, 2018 · 3 comments
Closed

IOException: Unknown GeoDistance ordinal [2] #29301

mloho opened this issue Mar 29, 2018 · 3 comments
Assignees
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes >bug

Comments

@mloho
Copy link

mloho commented Mar 29, 2018

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

@jkakavas jkakavas added the :Analytics/Geo Indexing, search aggregations of geo points and shapes label Mar 30, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@imotov imotov self-assigned this Mar 30, 2018
@imotov imotov added the >bug label Mar 30, 2018
@imotov
Copy link
Contributor

imotov commented Mar 30, 2018

It looks like we accidently broke backward compatibility here. Unfortunately, I cannot think of any temporary workaround besides using a client and a server with the same major version.

imotov added a commit to imotov/elasticsearch that referenced this issue Mar 31, 2018
Restores backward compatibility in GeoDistanceQueryBuilder serialization
between 6.x and 5.6 after removal of optimize_bbox parameter.

Closes elastic#29301
imotov added a commit that referenced this issue Apr 4, 2018
Restores backward compatibility in GeoDistanceQueryBuilder serialization
between 6.x and 5.6 after removal of optimize_bbox parameter.

Closes #29301
@imotov
Copy link
Contributor

imotov commented Apr 6, 2018

@mloho, thanks for the detailed report. It was fixed by #29325 and should be release in v6.3.0.

@imotov imotov closed this as completed Apr 6, 2018
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
Projects
None yet
Development

No branches or pull requests

4 participants