Hi folks,
I can't manage to have the new spatial filtering feature (added in
r962727 by Grant Ingersoll, see
https://issues.apache.org/jira/browse/SOLR-1568) working. I'm trying to
get all the documents located within a circle defined by its center and
radius.
I've modified my query url as specified in
http://wiki.apache.org/solr/SpatialSearch#Spatial_Filter_QParser to add
the "pt", "d" and "meas" parameters. Here is what my query parameters
looks like (from Solr's response with debug mode activated):
[params] => Array
(
[explainOther] => true
[mm] => 2<-75%
[d] => 50
[sort] => date asc
[qf] =>
[wt] => php
[rows] => 5000
[version] => 2.2
[fl] => object_type object_id score
[debugQuery] => true
[start] => 0
[q] => *:*
[meas] => hsin
[pt] => 48.85341,2.3488
[bf] =>
[qt] => standard
[fq] => +object_type:Concert
+date:[2010-07-19T00:00:00Z TO 2011-07-19T23:59:59Z]
)
With this query, I get 3859 results. And some (lots) of the found
documents are not located whithin the circle! :(
If I run the same query without spatial filtering (if I remove the "pt",
"d" and "meas" parameters from the url), I get 3859 results too. So it
looks like my spatial filtering constraint is not taken into account in
the first search query (the one where "pt", "d" and "meas" are set). Is
the wiki's doc up to date?
In the comments of SOLR-1568, I've seen someone talking about adding
"{!sfilt fl=latlon_field_name}". So I tried the following request:
[params] => Array
(
[explainOther] => true
[mm] => 2<-75%
[d] => 50
[sort] => date asc
[qf] =>
[wt] => php
[rows] => 5000
[version] => 2.2
[fl] => object_type object_id score
[debugQuery] => true
[start] => 0
[q] => *:*
[meas] => hsin
[pt] => 48.85341,2.3488
[bf] =>
[qt] => standard
[fq] => +object_type:Concert
+date:[2010-07-19T00:00:00Z TO 2011-07-19T23:59:59Z] +{!sfilt
fl=coords_lat_lon,units=km,meas=hsin}
)
This leads to 2713 results (which is smaller than 3859, good). But some
(lots) of the results are once more out of the circle :(
Can someone help me get spatial filtering working? I really don't
understand the search results I'm getting.
Cheers,
Olivier
--
- *Olivier RICORDEAU* -
oliv...@ricordeau.org
http://olivier.ricordeau.org