Incorrect example for Coordinates in Spatial document

Description

In the spatial documentation on http://docs.jboss.org/hibernate/search/4.2/reference/en-US/html/spatial.html under section 9.1.2. "Indexing coordinates in a Grid with Quad Trees", it says "add the @Latitude and @Longitude annotations on the properties representing your coordinates; "

However, to make it work I had to use "9.1.3. Implementing the Coordinates interface", because I have to use @Latitude(of="location") as well. I ended up mixing 9.1.2 and 9.1.3.

Here is my code:

I wonder is this a feature or a bug in the document that it doesn't describe the implementation correctly, or it is something that I've completely misunderstood?

Attached is my sample project again. Thank you for anyone whom look into this issue.

Thanks a lot
Sam

Attachments

1

Activity

Show:

Hardy Ferentschik October 7, 2013 at 9:48 AM

Let's reject the issue, if we don't get any more feedback.

Nicolas Helleringer May 14, 2013 at 3:47 PM

Just at the beginning of 9.1.3 you have :

Instead of using the @Latitude and @Longitude annotations you can choose to implement the org.hibernate.search.spatial.Coordinates interface.

So you should not use annotations AND interface at the same time for the same spatial pseudo field.

I actually does not understand where your problem is : is your code working or not ?

Looking at your test case, I seems to me that the @Longitude(of="location") and @Latitude(of="location") are not required as they refer to a "location" named spatial pseudo field which is not declared in a @Spatial annotation.

Thus, your code should work as the coordinates interface match the default named @Spatial annotation at class level.

Cannot Reproduce

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

Created January 28, 2013 at 3:23 PM
Updated January 29, 2014 at 2:37 PM
Resolved October 8, 2013 at 1:12 PM