You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Li Li <fa...@gmail.com> on 2010/06/23 05:13:50 UTC

about function query

I want to integrate document's timestamp into scoring of search. And I
find an example in the book "Solr 1.4 Enterprise Search Server" about
function query. I want to boost a document which is newer. so it may
be a function such as 1/(timestamp+1) . But the function query is
added to the final result, not multiplied. So I can't adjust the
parameter well.
e.g
search term is term1, topdocs are doc1 with score 2.0; doc2 with score 1.5.
search term is term2, topdocs are doc1 with score 20;  doc2 with score 15.
it is hard to adjust the relative score of these 2 docs with add a value.  i
if it is multiply, it's easy. if doc1 is very old, we assign a score
1,and doc2 is new, we assign a score 2
thus total score is 2.0*1 1.5*2 . So doc2 rank higher than doc1
but when use add,  2.0 + weight*1, 1.5 +weight*2, it's hard to get a
proper weight.
if we let weight is 1, it works well for term1
but with term2, it 20 +1*1.5 15+1*2  time has little influence on the
final result.

Re: about function query

Posted by Yonik Seeley <yo...@lucidimagination.com>.
See http://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_boost_the_score_of_newer_documents
for more info on how to do a multiplicative boost.

-Yonik
http://www.lucidimagination.com

On Tue, Jun 22, 2010 at 11:13 PM, Li Li <fa...@gmail.com> wrote:
> I want to integrate document's timestamp into scoring of search. And I
> find an example in the book "Solr 1.4 Enterprise Search Server" about
> function query. I want to boost a document which is newer. so it may
> be a function such as 1/(timestamp+1) . But the function query is
> added to the final result, not multiplied. So I can't adjust the
> parameter well.
> e.g
> search term is term1, topdocs are doc1 with score 2.0; doc2 with score 1.5.
> search term is term2, topdocs are doc1 with score 20;  doc2 with score 15.
> it is hard to adjust the relative score of these 2 docs with add a value.  i
> if it is multiply, it's easy. if doc1 is very old, we assign a score
> 1,and doc2 is new, we assign a score 2
> thus total score is 2.0*1 1.5*2 . So doc2 rank higher than doc1
> but when use add,  2.0 + weight*1, 1.5 +weight*2, it's hard to get a
> proper weight.
> if we let weight is 1, it works well for term1
> but with term2, it 20 +1*1.5 15+1*2  time has little influence on the
> final result.
>