lance-java
lance-java

Reputation: 27976

hibernate-search, spatial queries and the new lucene spatial module

I'm wanting to perform a spatial search in Hibernate. In particular, I'd like to store some items with a latitude / longitude then query which items are within x km of a given point.

I have found that the hibernate-search provides support for spatial queries through it's Lucene integration.

I also know that the spatial module in Lucene has been completely rewritten in Lucene version 4.0 but the latest version of hibernate-search is using Lucene 3.6.2 of Lucene.

So, I have a few questions:

  1. Is the spatial support in hibernate-search using the now deprecated lucene spatial module?
  2. Or does hibernate-search use a spatial module from solr?
  3. One of the reasons lucene spatial was rewritten is because it was unreliable / buggy. Does this mean that spatial queries in hibernate-search are unreliable?
  4. Will hibernate-search be changed in a future version to support the new lucene-spatial module? (based on spatial4j)
  5. Assuming that hibernate-search will be upgraded to Lucene 4+ in the future, are spatial queries in the new version likely to be backwards compatible with the current hibernate-search API's?

Upvotes: 1

Views: 910

Answers (1)

Sanne
Sanne

Reputation: 6107

  1. No it was not, we where lucky enough to get a geolocation field expert joining the team for your same reasons: Nicolas wanted to avoid using the spatial module in Lucene because of its problems.

  2. No it's a set of custom Lucene components; the embedded nature of Hibernate Search made our requirements very simple, at least in terms of Lucene integration (distance math is still interesting).

  3. The limitations from the original module where of inspiration and motivation to the creation of the new extension, so I believe not, assuming it's the same known limitations we talk about.

  4. That is very likely, our focus at this point is to provide a sensible and practical API; with the relatively simple functionality covered today we might not need to rush on it, but we're not excluding integrating it. A better support for Spatial types is planned for Hibernate ORM too, so we might want to integrate the custom types: help and advise is welcome, even if just in use case or wish form.

  5. We have been very proud of our API stability in the past and will try hard to maintain the record. We will definitely upgrade to Lucene 4+ but this will likely have to break some APIs (not necessarily related to Spatial). We're going to try hard to keep changes to the minimum. This is one of the reasons to not expose too much yet: make sure we keep flexibility for the implementation, at least now that we're preparing for the upgrade.

Upvotes: 4

Related Questions