You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Doron Cohen <cd...@gmail.com> on 2008/06/02 07:24:08 UTC

Re: How to add PageRank score with lucene's relevant score in sorting

Hi Jarvis,


>     I have a problem that how to "combine" two score to sort the search
> result documents.
>     for example I  have 10 million pages in lucene index , and i know their
> pagerank scores. i give a query to it , every docs returned have a
> lucene-score, mark it as R (relevant score), and  i  also  have its
> pagerank score, mark it as P,  what i need is i want to sort the search
> result base on the value "P+R".  You know if i store the pagerank score in
> index and get it every search time , then compute P+R , then sort it , this
> way is too slow. in my system , when the search hits 500000 result , the
> sort may cost about 20s.
>

Check CustomScoreQuery in
http://lucene.apache.org/java/2_3_2/api/core/org/apache/lucene/search/function/package-summary.html

Probably something like this:
- implement ValueSource on top of the pagerank values,
- create a valueSourceQuery on top of it,
- create a customScoreQuery on top of the original query and the
valueSourceQuery.
Note that by default, customScoreQuery multiplies the scores, but you can
override this.

Doron