My query is:
{ "query": { //Some query here }, "sort": [{ "_geo_distance": { "location": { "lat": 49.8693846, "lon": -99.9405093 }, "order": "asc", "unit": "m" } }] }
I need the code/hints which will let me form this sort at "query" level, programatically in Java. Please quote any classes that i can use.
On another project, I wrote something like:
SearchRequest request = new SearchRequest(banoIndexName) .source(new SearchSourceBuilder() .sort(new GeoDistanceSortBuilder("location", lat, lon).sortMode(SortMode.AVG)) );
HTH
Thanks !
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.