Geoshape search

Consider 2 users located at 2 different coordinates, 10 km apart. When they execute a spatial query with their coordinates and a radius of at least 10 km they find each other.

Now consider that each user also specifies a radius around their coordinates. If both users set a radius of 2 km then, for the same initial coordinates, they will find each other when executing a spatial query with a radius of at least 6 km.

Is there any out-of-the-box support for this kind of spatial range search?

If each users defines both a center and a radius, and wants to query the database for all users whose “circle” overlaps his own “circle”, then you need something similar to Elasticsearch’s geo_shape queries.

No, Hibernate Search does not provide this type of query at the moment. More importantly it doesn’t support storing geo_shapes even when using the Elasticsearch integration, which means even if you were able to run the queries (for example through the JSON query capability), there would be no data to query.

We would be interested in adding such a feature, but it’s more likely to make it to Search 6. If you’re interested in contributing, you could create a ticket and we could discuss it there?

Sure, created ticket HSEARCH-3214.