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 Amjad Khan <am...@gmail.com> on 2018/10/25 15:57:54 UTC

Score relevancy

Hi

Is there a way to achieve the following - 

We have a RANK field in each document, and essentially, I would like my score to be influenced by this RANK as follows -

score = score*0.1 + RANK

How can I achieve this with function queries?

Thanks!

Re: Score relevancy

Posted by Walter Underwood <wu...@wunderwood.org>.
Use a bf of 10 * RANK. That will give the same ordering as dividing the score by 10 and adding RANK.

There are problems with additive boosts, so I strongly recommend looking at the “boost” parameter, which is a multiplicative boost. That is more stable over a wide range of score values.

wunder
Walter Underwood
wunder@wunderwood.org
http://observer.wunderwood.org/  (my blog)

> On Oct 25, 2018, at 11:11 AM, Amjad Khan <am...@gmail.com> wrote:
> 
> We use ranking below 100 and yes it is float.
> 
>> On Oct 25, 2018, at 1:08 PM, David Hastings <ha...@gmail.com> wrote:
>> 
>> is this RANK value stored as a float/integer?  and whats the range?  one
>> idea is you could use edismax and have a really possible long boost query:
>> RANK:[1 TO 2]^10 OR RANK:[3 TO 4]^9
>> but this isnt actually a great idea and gets sloppy fast.  you could apply
>> boost at index time, or a function query at query time, both represented
>> here:
>> https://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_increase_the_score_for_specific_documents
>> 
>> 
>> 
>> On Thu, Oct 25, 2018 at 11:58 AM Amjad Khan <am...@gmail.com> wrote:
>> 
>>> Hi
>>> 
>>> Is there a way to achieve the following -
>>> 
>>> We have a RANK field in each document, and essentially, I would like my
>>> score to be influenced by this RANK as follows -
>>> 
>>> score = score*0.1 + RANK
>>> 
>>> How can I achieve this with function queries?
>>> 
>>> Thanks!
> 


Re: Score relevancy

Posted by Amjad Khan <am...@gmail.com>.
We use ranking below 100 and yes it is float.

> On Oct 25, 2018, at 1:08 PM, David Hastings <ha...@gmail.com> wrote:
> 
> is this RANK value stored as a float/integer?  and whats the range?  one
> idea is you could use edismax and have a really possible long boost query:
> RANK:[1 TO 2]^10 OR RANK:[3 TO 4]^9
> but this isnt actually a great idea and gets sloppy fast.  you could apply
> boost at index time, or a function query at query time, both represented
> here:
> https://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_increase_the_score_for_specific_documents
> 
> 
> 
> On Thu, Oct 25, 2018 at 11:58 AM Amjad Khan <am...@gmail.com> wrote:
> 
>> Hi
>> 
>> Is there a way to achieve the following -
>> 
>> We have a RANK field in each document, and essentially, I would like my
>> score to be influenced by this RANK as follows -
>> 
>> score = score*0.1 + RANK
>> 
>> How can I achieve this with function queries?
>> 
>> Thanks!


Re: Score relevancy

Posted by David Hastings <ha...@gmail.com>.
is this RANK value stored as a float/integer?  and whats the range?  one
idea is you could use edismax and have a really possible long boost query:
RANK:[1 TO 2]^10 OR RANK:[3 TO 4]^9
but this isnt actually a great idea and gets sloppy fast.  you could apply
boost at index time, or a function query at query time, both represented
here:
https://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_increase_the_score_for_specific_documents



On Thu, Oct 25, 2018 at 11:58 AM Amjad Khan <am...@gmail.com> wrote:

> Hi
>
> Is there a way to achieve the following -
>
> We have a RANK field in each document, and essentially, I would like my
> score to be influenced by this RANK as follows -
>
> score = score*0.1 + RANK
>
> How can I achieve this with function queries?
>
> Thanks!