Hi Weber, Returning the distance separately from the score is really awkward without being able to use geodist() (which is coming in Solr 4.5 for the RPT spatial field). But as you note in SOLR-4255 it is possible. If you modify the Solr example schema so that the 'store' spatial field is of type location_rpt, then your field list ('fl') parameter could do it like this:
fl=*,score,dist:query({!geofilt v='' filter=false score=distance sfield=store pt=-19.9240936,-43.9373343 d=200}) Here, 'd' isn't in effect but is required, and query() seems to demand 'v'. You can probably make the standard geofilt parameters top-level request parameters and thus share them between this sort and a spatial filter in an 'fq'. ~ David Weber wrote > I'm trying to get score by using a custom boost and also get the distance. > I found David's code* to get it using "Intersects", which I want to > replace by {!geofilt} or geodist() > > *David's code: https://issues.apache.org/jira/browse/SOLR-4255 > > He told me geodist() will be available again for this kind of field, which > is a geohash type. > > Then, I'd like to know how it can be done today on 4.4 with {!geofilt} and > how it will be done on 4.5 using geodist() > > Thanks in advance. ----- Author: http://www.packtpub.com/apache-solr-3-enterprise-search-server/book -- View this message in context: http://lucene.472066.n3.nabble.com/Solr-4-5-spatial-search-distance-and-score-tp4089706p4089970.html Sent from the Solr - User mailing list archive at Nabble.com.