New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HSEARCH-1918 Fix 180 meridian crossing issue #870
Closed
nicolashelleringer
wants to merge
1
commit into
hibernate:master
from
nicolashelleringer:HSEARCH-1918
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
orm/src/test/java/org/hibernate/search/test/spatial/DoubleIndexedPOI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/* | ||
* Hibernate Search, full-text search for your domain model | ||
* | ||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later | ||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. | ||
*/ | ||
package org.hibernate.search.test.spatial; | ||
|
||
import org.hibernate.search.annotations.Analyze; | ||
import org.hibernate.search.annotations.Field; | ||
import org.hibernate.search.annotations.FieldBridge; | ||
import org.hibernate.search.annotations.Index; | ||
import org.hibernate.search.annotations.Indexed; | ||
import org.hibernate.search.annotations.Latitude; | ||
import org.hibernate.search.annotations.Longitude; | ||
import org.hibernate.search.annotations.Spatial; | ||
import org.hibernate.search.annotations.Store; | ||
import org.hibernate.search.spatial.SpatialFieldBridgeByHash; | ||
import org.hibernate.search.spatial.Coordinates; | ||
|
||
import javax.persistence.Embedded; | ||
import javax.persistence.Entity; | ||
import javax.persistence.Id; | ||
|
||
/** | ||
* Hibernate Search spatial : Double indexed Point Of Interest test entity for | ||
* cheching behavior between @Latitude+@Longitude and @FieldBridge | ||
* | ||
* @author Nicolas Helleringer <nicolas@hibernate.org> | ||
*/ | ||
@Entity | ||
@Indexed | ||
@Spatial | ||
public class DoubleIndexedPOI { | ||
@Id | ||
Integer id; | ||
|
||
@Field(store = Store.YES) | ||
String name; | ||
|
||
@Field(store = Store.YES, index = Index.YES) | ||
String type; | ||
|
||
@Latitude | ||
@Field(store = Store.YES, index = Index.YES) | ||
double latitude; | ||
|
||
@Longitude | ||
@Field(store = Store.YES, index = Index.YES) | ||
double longitude; | ||
|
||
@Field(store = Store.YES, index = Index.YES, analyze = Analyze.NO) | ||
@FieldBridge(impl = SpatialFieldBridgeByHash.class) | ||
@Embedded | ||
public Coordinates getLocation() { | ||
return new Coordinates() { | ||
@Override | ||
public Double getLatitude() { | ||
return latitude; | ||
} | ||
|
||
@Override | ||
public Double getLongitude() { | ||
return longitude; | ||
} | ||
}; | ||
} | ||
|
||
public DoubleIndexedPOI(Integer id, String name, double latitude, double longitude, String type) { | ||
this.id = id; | ||
this.name = name; | ||
this.latitude = latitude; | ||
this.longitude = longitude; | ||
this.type = type; | ||
} | ||
|
||
public DoubleIndexedPOI() { | ||
} | ||
|
||
public Integer getId() { | ||
return id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public double getLatitude() { | ||
return latitude; | ||
} | ||
|
||
public double getLongitude() { | ||
return longitude; | ||
} | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi just curious why are you intentionally using the explicit bridge, rather than the Spatial annotation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did the same way the infinispan code did it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks!
On 20 Jul 2015 17:42, "Nicolas Helleringer" notifications@github.com
wrote: