The search query is about finding all documents by Geo distance, that are located no further than the radius specified in the document from the location specified in the document. I could do this using a script:
one idea would be to change your document to index the location+radius together as a geo shape field. Then you could e.g. use a corresponding geo shape query to find all documents that intersect with a given point.
The slightly compromise in accuracy should not matter most of the time, and you can tune your configuration to give you the storage space / accuracy tradeoff that you need.
I didn't do any research and tuning on the geoshape mapping settings, 1m precision might be more than needed here and also the choice of quadtree is arbitrary. I played around with the reference point in the query and it seems to be doing what is expected. I cannot say much in terms of memory / storage / performance requirements compared to the script solution, but if that's no option then this is maybe a good starting point.
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.