Syntax error while parsing Spatial Query

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Syntax error while parsing Spatial Query

vas aj
Hi team, 

I am using Lucene 6.6.2, Spatial4j 0.7, lucene-spatial-extras 6.6.2. I am trying to create a Spatial Query string for a given longitude, latitude & radius in miles. 

The query string generated using SpatialHelper (code as attached ) for long: -122.8515139 & lat: 45.5099231 in .25 miles radius  is as follow : 

#(+location__x:[-122.85667708964212 TO -122.84635071035788] +location__y:[45.50630481040378 TO 45.51354138959622]) #frange(DistanceValueSource(PointVectorStrategy field:location ctx=SpatialContext.GEO, Pt(x=-122.8515139,y=45.5099231))):[0.0 TO 0.00361828959621958]

My lucene index is as follows:
create lucene index --name=myLuceneIndex --region=stations --field=title --analyzer=org.apache.lucene.analysis.en.EnglishAnalyzer

I get error
Syntax Error, cannot parse ConstantScore(#(+location__x:[-122.85667708964212 TO -122.84635071035788] +location__y:[45.50630481040378 TO 45.51354138959622]) #frange(DistanceValueSource(PointVectorStrategy field:location ctx=SpatialContext.GEO, Pt(x=-122.8515139,y=45.5099231))):[0.0 TO 0.00361828959621958]): 

What am I doing wrong ?

Regards,
Aj



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

SpatialHelper.java (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Syntax error while parsing Spatial Query

Michele Palmia
Hey Aj, how are you executing the query exactly? Your code only shows query
generation, and it works fine when creating and searching documents via the
Java api.
I assume you're using Geode to run your query? Can you show how you're
actually using it to run queries?

Cheers,
Michele