tags:

views:

42

answers:

1

Hi,

I have a basic solr installation which store articles (title, description, date)

If I search for golf club and sort it by date I get every articles with golf or club in the title or description.

If I sort it by score I get the one with golf club first.

Is there a way to boost those with golf clubs and then get those with either golf or club sorted by date?

+1  A: 

Not really.... You only get one "sort", and normally that is by the relevancy score calculated by Solr. If you use the sort parameter, then it overrides everything else.

I am guessing the reason you are sorting by date is becasue you want newer articles to show up higher. So what you should do is still do a normal query where the order is by score, but use a boost function to boost those with a more recent date. That way, if two articles are the same relevancy, but one is newer then the other, then it will show up first. However, if you have a REALLY relevant article that is older, it will still show up at the top.

Eric Pugh
That's what I thought. I think I have to dig in the documentation to figured out how to create the right boost function.
stunti