Hi Grant, Thanks for the tip This seems to work:
q=*:* fq={!func}geodist() sfield=store pt=49.45031,11.077721 fq={!bbox} sfield=store pt=49.45031,11.077721 d=40 fl=store sort=geodist() asc On Thu, Feb 3, 2011 at 7:46 PM, Grant Ingersoll <gsing...@apache.org> wrote: > Use a filter query? See the {!geofilt} stuff on the wiki page. That gives > you your filter to restrict down your result set, then you can sort by exact > distance to get your sort of just those docs that make it through the > filter. > > > On Feb 3, 2011, at 10:24 AM, Eric Grobler wrote: > > > Hi Erick, > > > > Thanks I saw that example, but I am trying to sort by distance AND > specify > > the max distance in 1 query. > > > > The reason is: > > running bbox on 2 million documents with a 20km distance takes only > 200ms. > > Sorting 2 million documents by distance takes over 1.5 seconds! > > > > So it will be much faster for solr to first filter the 20km documents and > > then to sort them. > > > > Regards > > Ericz > > > > On Thu, Feb 3, 2011 at 1:27 PM, Erick Erickson <erickerick...@gmail.com > >wrote: > > > >> Further down that very page <G>... > >> > >> Here's an example of sorting by distance ascending: > >> > >> - > >> > >> ...&q=*:*&sfield=store&pt=45.15,-93.85&sort=geodist() > >> asc< > >> > http://localhost:8983/solr/select?wt=json&indent=true&fl=name,store&q=*:*&sfield=store&pt=45.15,-93.85&sort=geodist()%20asc > >>> > >> > >> > >> > >> > >> The key is just the &sort=geodist(), I'm pretty sure that's independent > of > >> the bbox, but > >> I could be wrong. > >> > >> Best > >> Erick > >> > >> On Wed, Feb 2, 2011 at 11:18 AM, Eric Grobler < > impalah...@googlemail.com > >>> wrote: > >> > >>> Hi > >>> > >>> In http://wiki.apache.org/solr/SpatialSearch > >>> there is an example of a bbox filter and a geodist function. > >>> > >>> Is it possible to do a bbox filter and sort by distance - combine the > >> two? > >>> > >>> Thanks > >>> Ericz > >>> > >> > > -------------------------- > Grant Ingersoll > http://www.lucidimagination.com/ > > Search the Lucene ecosystem docs using Solr/Lucene: > http://www.lucidimagination.com/search > >