0

I am using Solr for my mobile applications and it works really well. For now, I use Solr to search for users, sorted by distance. But now I want to boost the results that are fresher and leave the oldest one at the end of the results.

I have a last_active_datetime field in my schema, not multivalued:

<field name="last_active_datetime"  type="date" indexed="true" stored="true" multiValued="false" />

How can I sort the results by distance and leave the old results at the end? Before I did this:

sort=geodist()asc

And now, I am trying this:

sort=geodist()asc, last_active_datetime desc

But I don't see any difference in the results. Do I have to put a weight to the sorting fields?

Thanks!

litil
  • 413
  • 1
  • 6
  • 19

1 Answers1

2

It is quite easy:

  1. in case you are not using it already, use edismax parser
  2. now you can weight the score with bf, so boost closer docs, see here
  3. and also boost the recent documents, see this SO question
Community
  • 1
  • 1
Persimmonium
  • 15,593
  • 11
  • 47
  • 78
  • Thanks, that was just what I needed. I was using edismax parser so I just add 2 boosting filters and now it works! – litil Aug 08 '12 at 21:40