need to get only documents which distance of between each documents location higher than Xkm
e.g. first we get first document (id#1) and if distance between second document (id#2) and first document (id#1) location higher than Xkm, we include, if not check with third document (id#3)
Once you have your lat-lon from document #1, you can write a Geo Distance Range Query to find all documents at least Xkm away from document #1's location.
thanks for your reply,
but the query is not suitable, you maybe misunderstood
need select those documents which their distance greater than a number from each others, not from only first document or specific geo coord, it maybe #3 <=> #2, #4 <=> #5, #3<=> #5, ....
Sorry, I'm not familiar with any single ES query that would solve a proximity problem like that. The brute force approach of iterating through your set of points and running that Geo Distance Range Query is probably the most straightforward, but you may be able to implement something faster using computational geometry, like in the closest pair of points problem.
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.