The new spatial filtering (SOLR-1586) works great and is much faster than fq={!frange. However, I am having problems sorting by distance. If I try GET 'http://localhost:8983/solr/select/?q=*:*&sort=dist(2,latitude,longitude,0,0)+asc' I get an error: Error 400 can not sort on unindexed field: dist(2,latitude,longitude,0,0)
I was able to work around this with GET 'http://localhost:8983/solr/select/?q=*:* AND _val_:"recip(dist(2, latitude, longitude, 0,0),1,1,1)"&fl=*,score' But why isn't sorting by functions working? I get this error with any function I try to sort on.This is a nightly trunk build from Aug 25th. I see SOLR-1297 was reopened, but that seems to be for edge cases. Second question: I am using the LatLonType from the Spatial Filtering wiki, http://wiki.apache.org/solr/SpatialSearch Are there any distance sorting functions that use this field, or do I need to have three indexed fields, store_lat_lon, latitude, and longitude, if I want both filtering and sorting by distance. Thanks, Scott