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 funkdified <fu...@gmail.com> on 2014/04/21 01:23:08 UTC

Sunspot SolrException: The field location_s does not support spatial filtering

For reference here is the gem (plugin) I am using
https://github.com/sunspot/sunspot/

I am trying to run this command as part of my solr search:

    with(:location).in_radius(x, y, 50, :bbox => true)

I have defined this in my model definition:

    location :location do
      Sunspot::Util::Coordinates.new(latitude, longitude) if self.latitude
    end

I can run this command: 

    with(:location).near(x, y, :precision => 3)

However, **I can't run the in-radius search**, which is what I really need.

Here is the server log:

      SOLR Request (5.0ms)  [ path=#<RSolr::Client:0x00000006fc4fa8>
parameters={data:
fq=type%3ADispenser&fq=%7B%21bbox+sfield%3Dlocation_s+pt%3D29.7601927%2C-95.36938959999999+d%3D50%7D&start=0&rows=10&q=%2A%3A%2A,
method: post, params: {:wt=>:ruby}, query: wt=ruby, headers:
{"Content-Type"=>"application/x-www-form-urlencoded; charset=UTF-8"}, path:
select, uri: http://localhost:8982/solr/select?wt=ruby, open_timeout: ,
read_timeout: , retry_503: , retry_after_limit: } ]
    Completed 500 Internal Server Error in 293.3ms
    
    RSolr::Error::Http - RSolr::Error::Http - 500 Internal Server Error
    Error:     The field location_s does not support spatial filtering
    
    org.apache.solr.common.SolrException: The field location_s does not
support spatial filtering
    	at
org.apache.solr.search.SpatialFilterQParser.parse(SpatialFilterQParser.java:86)
    	at org.apache.solr.search.QParser.getQuery(QParser.java:142)
    	at
org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:114)
    	at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:173)
    	at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
    	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1372)
    	at
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
    	at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
    
    Request Data:
"fq=type%3ADispenser&fq=%7B%21bbox+sfield%3Dlocation_s+pt%3D29.7601927%2C-95.36938959999999+d%3D50%7D&start=0&rows=10&q=%2A%3A%2A"



--
View this message in context: http://lucene.472066.n3.nabble.com/Sunspot-SolrException-The-field-location-s-does-not-support-spatial-filtering-tp4132262.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Sunspot SolrException: The field location_s does not support spatial filtering

Posted by funkdified <fu...@gmail.com>.
By the way, for anyone interested in seeming my schema.xml:

https://gist.github.com/funkdified/3b503314738b97ab19e8



--
View this message in context: http://lucene.472066.n3.nabble.com/Sunspot-SolrException-The-field-location-s-does-not-support-spatial-filtering-tp4132262p4132263.html
Sent from the Solr - User mailing list archive at Nabble.com.