Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to boost fields in solr

I already have the boost determined before hand. I have a field in the solr index called boost1 . This boost field will have a value from 1 to 10 similar to google PR rank. This is the boost that should be applied to every query ran in solr. here are the fields in my index

  • Id
  • Title
  • Text
  • Boost1

The boost field should be apply to every query. I am trying to implement functionality similar to Google PR rank. Is there a way to do this using solr?

like image 752
Luke101 Avatar asked Oct 09 '11 05:10

Luke101


People also ask

What is boosting in Solr?

The process of giving higher relevance to a set of documents over others is called boosting, Solr support at least four ways of changing the boost factors of the documents: By boosting terms q=black^2.0 .

What is BQ in Solr?

The bq (Boost Query) Parameter The bq parameter specifies an additional, optional, query clause that will be added to the user's main query to influence the score.

What is score in Solr?

One of the factor for calculating fieldNorm is the length of text in the searched field. Shorter the field text length (Number of terms in field) higher is the score. Since text length of summary field in document (978-0641723445) is less than text length of summary field in document (978-1423103349)


1 Answers

you can add the boost during query e.g.

q={!boost b=boost1}

How_can_I_boost_the_score_of_newer_documents

However, this may need to be added explicitly by you.

If you are using dismax or edismax with the request handler, The bf (Boost Functions) parameter could be used to boost the documents. http://wiki.apache.org/solr/DisMaxQParserPlugin#bf_.28Boost_Functions.29

bf=boost1^0.5

This can be added to defaults with the request handler definition, so that they are applied to all the search queries.

you can use function queries to vary the amount of boost FunctionQuery

like image 99
Jayendra Avatar answered Sep 19 '22 18:09

Jayendra