I guess I'm having trouble understanding this. "I just wanted all the results, along with an option to sort the results, if the user wants it."
What does "all the results" mean? The results you would have had if it you didn't have a sort? There's no way to guarantee that the results returned by relevance contain the range you want, unless you really do return all the results, possibly thousands to millions of documents. If you used an fq clause, the app could sort the results without executing another search if you wanted to sort them by date... Best Erick On Mon, Aug 22, 2011 at 3:56 AM, Sowmya V.B. <vbsow...@gmail.com> wrote: > Dear All > > I have been searching on how to sort Solr results based on a range > query..but did not find decipherable answers. Hence, mailing again. Sorry if > the query was already posed -i was not able to find it. > > I want to add an option to sort the results, based on a field range chosen. > (For eg: "Sort Results based on the Field A, being from 20 to 30", "Sort in > such a way that the date field points to dates between August 1st to 10th" > etc) > > I don't want to Filter the results. I just wanted all the results, along > with an option to sort the results, if the user wants it. > > Is there anything in Solr, the allows me sort by range? > > I Tried giving something like this, following the Sort-without-range > specification syntax, and needless to say, it threw me syntax error. > http://localhost:8080/ir4llsolr/select?indent=on&version=2.2&q=xyz&start=0&rows=10&fl=title%2Cdate&sort=Field1:[20TO > 30] asc > > http://localhost:8080/ir4llsolr/select?indent=on&version=2.2&q=xyz&start=0&rows=10&fl=title%2Cdate&sortBy=Field1:[20TO > 30] asc > -Does not throw a Syntax error, but does not seem to work anyways. > > Thanks for the help! > > Sowmya. > > -- > Sowmya V.B. > ---------------------------------------------------- > Losing optimism is blasphemy! > http://vbsowmya.wordpress.com > ---------------------------------------------------- >