kailash19
kailash19

Reputation: 1821

Solr boost score based on wikipedia PageRank and solr score

I have solr indexed wikipedia dump. I get the results from solr query which have results shown according to the lucene score.

In the indexed files from Wikipedia i also have the field: PageRank calculated based on the inbound links to the title.

I want to get more relevant results based on the lucene score and the PageRank field.

What should be my approach here?. How can i boost the results based on both the values.

Appreciate any leads.

Upvotes: 3

Views: 984

Answers (1)

magnum87
magnum87

Reputation: 344

If you are using the standard query parser or extended dismax, you can use this query

q=[your query]+AND+_val_:"PageRank"

Using both regular document score AND custom score based on the value of a field is the default behavior when you use the SolR FunctionQuery with the _val_ hook. See here: http://wiki.apache.org/solr/FunctionQuery#Using_FunctionQuery

If you use a function query as 'just another term' (for example, by using the special field name val), the value of the function becomes a component of the overall query score, just as with any other part of the query. This includes the standard normalization, which amounts (by default) to multiplying scores by a magic constant (by default, that is inverse of the square root of the sum of squared weights).

Upvotes: 3

Related Questions