stunti
stunti

Reputation: 855

boost result with sentence matching in solr

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?

Upvotes: 0

Views: 334

Answers (1)

Eric Pugh
Eric Pugh

Reputation: 1573

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.

Upvotes: 2

Related Questions