Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Geo distance which api can support #688

Open
yzhilin opened this issue Aug 21, 2020 · 0 comments
Open

Geo distance which api can support #688

yzhilin opened this issue Aug 21, 2020 · 0 comments

Comments

@yzhilin
Copy link

yzhilin commented Aug 21, 2020

String query = "{
"sort": [
{
"_geo_distance": {
"warehouseLatLngAddress": [120.174381,31.254079],
"order": "asc",
"unit": "km"
}
}
],
"query": {
"bool": {
"must": [
{
"terms": {
"warehouseId": [1,2]
}
}
]
}
}
}"
Search search = new Search.Builder(query)
// multiple index or types can be added.
.addIndex(INDEX)
.addType(TYPE)
.build();

response : "reason":"org.elasticsearch.index.fielddata.plain.SortedNumericDVIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexGeoPointFieldData"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant