Created
November 7, 2013 15:21
-
-
Save Alexerson/7356362 to your computer and use it in GitHub Desktop.
ElasticSearch _geo_distance sort error.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl "localhost:9200/api/_search?pretty=true" -d '{ | |
"query":{ | |
"term":{ | |
"django_ct":"auth.user" | |
} | |
} | |
}' | |
{ | |
"took" : 3, | |
"timed_out" : false, | |
"_shards" : { | |
"total" : 5, | |
"successful" : 5, | |
"failed" : 0 | |
}, | |
"hits" : { | |
"total" : 3509, | |
"max_score" : 3.1359458, | |
"hits" : [ { | |
"_index" : "api", | |
"_type" : "modelresult", | |
"_id" : "auth.user.323", | |
"_score" : 3.1359458, | |
"_source" : { | |
"django_id": "323", "last_name": "xxx", "first_name": "xxx", "django_ct": "auth.user", "content_auto": "xxx xxx", "location": "48.0513369,-65.459684"} | |
}, | |
.... etc. | |
curl "localhost:9200/api/_search?pretty=true" -d '{ | |
"query":{ | |
"term":{ | |
"django_ct":"auth.user" | |
} | |
}, | |
"sort":[ | |
{ | |
"_geo_distance":{ | |
"unit":"km", | |
"location": "48, -65" | |
} | |
} | |
] | |
}' | |
{ | |
"error" : "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[O0acdq3ySwWsVXUi6-mwWw][api][0]: SearchParseException[[api][0]: query[django_ct:auth.user],from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"term\":{\"django_ct\":\"auth.user\"}}, \"sort\":[{\"_geo_distance\":{\"unit\":\"km\", \"location\": \"48, -65\"}}]}]]]; nested: ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexGeoPointFieldData]; }{[O0acdq3ySwWsVXUi6-mwWw][api][1]: SearchParseException[[api][1]: query[django_ct:auth.user],from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"term\":{\"django_ct\":\"auth.user\"}}, \"sort\":[{\"_geo_distance\":{\"unit\":\"km\", \"location\": \"48, -65\"}}]}]]]; nested: ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexGeoPointFieldData]; }{[O0acdq3ySwWsVXUi6-mwWw][api][4]: SearchParseException[[api][4]: query[django_ct:auth.user],from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"term\":{\"django_ct\":\"auth.user\"}}, \"sort\":[{\"_geo_distance\":{\"unit\":\"km\", \"location\": \"48, -65\"}}]}]]]; nested: ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexGeoPointFieldData]; }{[O0acdq3ySwWsVXUi6-mwWw][api][2]: SearchParseException[[api][2]: query[django_ct:auth.user],from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"term\":{\"django_ct\":\"auth.user\"}}, \"sort\":[{\"_geo_distance\":{\"unit\":\"km\", \"location\": \"48, -65\"}}]}]]]; nested: ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexGeoPointFieldData]; }{[O0acdq3ySwWsVXUi6-mwWw][api][3]: SearchParseException[[api][3]: query[django_ct:auth.user],from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"term\":{\"django_ct\":\"auth.user\"}}, \"sort\":[{\"_geo_distance\":{\"unit\":\"km\", \"location\": \"48, -65\"}}]}]]]; nested: ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexGeoPointFieldData]; }]", | |
"status" : 400 | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment