You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by nickdos <ni...@remedios-cole.id.au> on 2010/06/10 08:18:35 UTC

3.1-dev spatial search problem

I'm running the 3.x branch and I'm trying to implement spatial searching. 

I am able to sort results by distance from a given lat/long using a query
like:

http://localhost:8080/solr/select/?q=_val_:"recip(dist(2, lat_long,
vector(-66.5,75.1)),1,1,0)"&fl=*,score

which gives me the expected results sorted by distance (location field type
called lat_long). 

However I cannot perform a spatial filter on the results.

When I try either:

http://localhost:8080/solr/select/?q={!sfilt fl=location}&pt=-65.5,75.2&d=20

http://localhost:8080/solr/select/?q={!sfilt fl=lat_long}&pt=-65.5,75.2&d=20

I get the following error:

SEVERE: org.apache.solr.common.SolrException: Unknown query type 'sfilt'

I have tried various forms of this query to no avail. Any suggestions?
-- 
View this message in context: http://lucene.472066.n3.nabble.com/3-1-dev-spatial-search-problem-tp884741p884741.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: 3.1-dev spatial search problem

Posted by Darren Govoni <da...@ontrenet.com>.
>>From what I can tell, the spatial stuff is incomplete and not entirely
functional at this point.

In the trunk I get the same error, but also I get results no matter what
the distance is, so it was broke as of last week for me.

On Wed, 2010-06-09 at 23:18 -0700, nickdos wrote:

> I'm running the 3.x branch and I'm trying to implement spatial searching. 
> 
> I am able to sort results by distance from a given lat/long using a query
> like:
> 
> http://localhost:8080/solr/select/?q=_val_:"recip(dist(2, lat_long,
> vector(-66.5,75.1)),1,1,0)"&fl=*,score
> 
> which gives me the expected results sorted by distance (location field type
> called lat_long). 
> 
> However I cannot perform a spatial filter on the results.
> 
> When I try either:
> 
> http://localhost:8080/solr/select/?q={!sfilt fl=location}&pt=-65.5,75.2&d=20
> 
> http://localhost:8080/solr/select/?q={!sfilt fl=lat_long}&pt=-65.5,75.2&d=20
> 
> I get the following error:
> 
> SEVERE: org.apache.solr.common.SolrException: Unknown query type 'sfilt'
> 
> I have tried various forms of this query to no avail. Any suggestions?