With JBOSS 7.1.1.Final and Hibernate-search-4.2.0, when I used onDefaultCoordinates (), the search with radius not calculated correctly for its range.
Here is the code with onDefaultCoordinates ():
Code:
.must(qb.spatial()
.onDefaultCoordinates ()
.within( radius, Unit.KM )
.ofLatitude( lat )
.andLongitude( lon ).createQuery()
While with onCoordinates(".."), it failed in run-time with the following exception:
Quote:
21:57:33,496 FINE [org.apache.cxf.endpoint.ClientImpl] (http--192.168.1.20-8080-4) set responseContext to be{org.apache.cxf.client=true, org.apache.cxf.message.Message.PROTOCOL_HEADERS={connection=[close], Content-Length=[389], content-type=[text/xml;charset=UTF-8], Date=[Tue, 29 Jan 2013 10:57:33 GMT], Server=[Apache-Coyote/1.1]}, org.apache.cxf.message.inbound=true, Content-Type=text/xml;charset=UTF-8, org.apache.cxf.message.Message.ENCODING=UTF-8, org.apache.cxf.message.Message.RESPONSE_CODE=500, org.apache.cxf.binding.soap.SoapVersion=org.apache.cxf.binding.soap.Soap11@18aa8713, org.apache.cxf.ws.policy.AssertionInfoMap={}, org.apache.cxf.headers.Header.list=[]}
21:57:33,524 DEBUG [org.jboss.modules] (http--192.168.1.20-8080-4) Module org.jboss.ws.saaj-impl:main defined by local module loader @744a6cbf (roots: /usr/local/users/jboss/jboss711Final/modules)
21:57:33,605 ERROR [org.jboss.ejb3.invocation] (http--192.168.1.20-8080-4) JBAS014134: EJB Invocation failed on component MyisamProductArticleManagerBean for method public abstract java.util.List ForestsurfClient.manager.MyisamProductArticleManagerLocal.search(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.Double,java.lang.Double,java.lang.Double,java.lang.Integer,java.lang.Integer): javax.ejb.EJBException: java.lang.RuntimeException: javax.xml.ws.soap.SOAPFaultException: javax.ejb.EJBException: org.hibernate.search.SearchException: HSEARCH000131: The field used for the spatial query is not using SpatialFieldBridge: ForestSurf.entity.MyisamProductArticle.location
at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:166) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:230) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
The code with onCoordinates("..") us shown as below:
Code:
.must(qb.spatial()
.onCoordinates( "location" )
.within( radius, Unit.KM )
.ofLatitude( lat )
.andLongitude( lon ).createQuery()
Any suggestion is highly appreciated.
Thanks
Samuel