[ 
https://issues.apache.org/jira/browse/SOLR-4255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13542304#comment-13542304
 ] 

David Smiley commented on SOLR-4255:
------------------------------------

As an example, to boost by the reciprocal distance (scores from 1 down to 0.1 
at query shape edge), return the distance, and filter by distance, but not use 
the 'q' param for the spatial so that it can be used for keyword search, it 
would look like this:

{noformat}
http://localhost:8983/solr/collection1/select?
defType=edismax
&q.alt=*:*
&debugQuery=on
&fl=*,score,distdeg:query({! score=distance filter=false v=$spatialfilter})
&boost=query({! score=recipDistance filter=false v=$spatialfilter})
&fq={! v=$spatialfilter}
&spatialfilter=geo:"Intersects(Circle(54.729696,-98.525391 d=10))"
{noformat}

That example works on the example data with a "geo" field of type 
"location_rpt" and a copyField from "store" to "geo".

                
> Solr 4 spatial- Add a filter=false local-param to just use the distance based 
> valuesource
> -----------------------------------------------------------------------------------------
>
>                 Key: SOLR-4255
>                 URL: https://issues.apache.org/jira/browse/SOLR-4255
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: David Smiley
>            Assignee: David Smiley
>             Fix For: 4.1
>
>
> The Solr 4 spatial fields use AbstractSpatialFieldType and by default only 
> filter and supply 1 as the constant score.  For sorting or boosting, you can 
> add the local-param score="distance" (or recipDistance) option to have the 
> score of the query be as specified.  However this query still filters, and in 
> some cases this is redundant.  For example you probably already have a filter 
> query doing the filter portion, and then you are again using the shape 
> reference here for a boost query.
> The change is a simple matter of returning the FunctionQuery and not wrapping 
> it in FilteredQuery.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

Reply via email to