Hi everybody,
I'm trying to add a sort on a geo_point field but get a ClassCastException.
The query:
{
"query": {
"match_all": {}
},
"size": 10,
"sort": {
"dealerLocation": {
"order": "asc"
}
}
}
the mapping
{
"usedcar": {
"properties": {
"dealerId": {
"type": "string"
},
"dealerLocation": {
"type": "geo_point"
}
}
}
}
the result
{
"error": "SearchPhaseExecutionException[Failed to execute phase
[query], total failure; shardFailures {[6qz3pf-nTp-raW4PxwknnQ][en_gb][3]:
QueryPhaseExecutionException[[en_gb][3]:
query[ConstantScore(NotDeleted(cache(_type:usedcar)))],from[0],size[10],sort[<custom:"dealerLocation":
org.elasticsearch.index.mapper.geo.GeoPointFieldDataType$1@1bd5b5b>]: Query
Failed [Failed to execute main query]]; nested:
ClassCastException[org.elasticsearch.index.mapper.geo.SingleValueGeoPointFieldData
cannot be cast to
org.elasticsearch.index.field.data.strings.SingleValueStringFieldData];
}{[6qz3pf-nTp-raW4PxwknnQ][en_gb][0]:
QueryPhaseExecutionException[[en_gb][0]:
query[ConstantScore(NotDeleted(cache(_type:usedcar)))],from[0],size[10],sort[<custom:"dealerLocation":
org.elasticsearch.index.mapper.geo.GeoPointFieldDataType$1@1e78c5e>]: Query
Failed [Failed to execute main query]]; nested:
ClassCastException[org.elasticsearch.index.mapper.geo.SingleValueGeoPointFieldData
cannot be cast to
org.elasticsearch.index.field.data.strings.SingleValueStringFieldData];
}{[6qz3pf-nTp-raW4PxwknnQ][en_gb][4]:
QueryPhaseExecutionException[[en_gb][4]:
query[ConstantScore(NotDeleted(cache(_type:usedcar)))],from[0],size[10],sort[<custom:"dealerLocation":
org.elasticsearch.index.mapper.geo.GeoPointFieldDataType$1@b09747>]: Query
Failed [Failed to execute main query]]; nested:
ClassCastException[org.elasticsearch.index.mapper.geo.SingleValueGeoPointFieldData
cannot be cast to
org.elasticsearch.index.field.data.strings.SingleValueStringFieldData]; }]",
"status": 500
}
Any idea ?
Regards,
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.