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 Mark Sholund <ma...@protonmail.com.INVALID> on 2019/06/28 02:54:07 UTC

qf in conjunction with boost

Hello,

I have been using the following to boost based on field content.

qf=title^5 description^5 _text_

And now I want to include additional boosting based on a popularity score include with some documents. I’ve done this as follows

q={!boost b=map(popularity_d,0,0,1)}<query terms>

However now it seems that the score is the same regardless of whether qf is included or not - this renders qf irrelevant to my query.

Can I do both of these boostings?  A multiplicative boost on the fields is acceptable if that’s possible and simplifies an answer.

- Mark

Re: qf in conjunction with boost

Posted by Mark Sholund <ma...@protonmail.com.INVALID>.
No responses yet, is my question unclear or is this not possible?

On Thu, Jun 27, 2019 at 10:54 PM, Mark Sholund <ma...@protonmail.com> wrote:

> Hello,
>
> I have been using the following to boost based on field content.
>
> qf=title^5 description^5 _text_
>
> And now I want to include additional boosting based on a popularity score include with some documents. I’ve done this as follows
>
> q={!boost b=map(popularity_d,0,0,1)}<query terms>
>
> However now it seems that the score is the same regardless of whether qf is included or not - this renders qf irrelevant to my query.
>
> Can I do both of these boostings?  A multiplicative boost on the fields is acceptable if that’s possible and simplifies an answer.
>
> - Mark

Re: qf in conjunction with boost

Posted by Mark Sholund <ma...@protonmail.com.INVALID>.
On further reading it seems that maybe

&boost=map(popularity_d,0,0,1) might work

On Sat, Jun 29, 2019 at 8:56 PM, Shawn Heisey <ap...@elyograg.org> wrote:

> On 6/27/2019 8:54 PM, Mark Sholund wrote:
>> qf=title^5 description^5 _text_
>>
>> And now I want to include additional boosting based on a popularity
>> score include with some documents. I’ve done this as follows
>>
>> q={!boost b=map(popularity_d,0,0,1)}<query terms>
>>
>> However now it seems that the score is the same regardless of whether qf
>> is included or not - this renders qf irrelevant to my query.
>
> qf is a parameter for the dismax and edismax query parsers, but your
> query has changed to the boost query parser. It is very unlikely that
> the boost parser uses the qf parameter.
>
> It looks like using edismax with its "boost" parameter MIGHT be what you
> are after:
>
> https://lucene.apache.org/solr/guide/8_1/the-extended-dismax-query-parser.html
>
> The edismax parser also supports the bq and bf parameters from the
> dismax parser:
>
> https://lucene.apache.org/solr/guide/8_1/the-dismax-query-parser.html#bq-boost-query-parameter
>
> Thanks,
> Shawn

Re: qf in conjunction with boost

Posted by Mark Sholund <ma...@protonmail.com.INVALID>.
Thanks for you reply.

The problem I ran into with using the boost parameter was that not all of my documents have the boosting field and those were coming back with a score of zero.  I tried setting a default for that field but it didn’t help. I found somewhere that using the boost parser with a map function would get me around that and it seemed to until I noticed that the qf parameter was being ignored. Maybe I can use bf instead.

Sent from ProtonMail Mobile

On Sat, Jun 29, 2019 at 8:56 PM, Shawn Heisey <ap...@elyograg.org> wrote:

> On 6/27/2019 8:54 PM, Mark Sholund wrote:
>> qf=title^5 description^5 _text_
>>
>> And now I want to include additional boosting based on a popularity
>> score include with some documents. I’ve done this as follows
>>
>> q={!boost b=map(popularity_d,0,0,1)}<query terms>
>>
>> However now it seems that the score is the same regardless of whether qf
>> is included or not - this renders qf irrelevant to my query.
>
> qf is a parameter for the dismax and edismax query parsers, but your
> query has changed to the boost query parser. It is very unlikely that
> the boost parser uses the qf parameter.
>
> It looks like using edismax with its "boost" parameter MIGHT be what you
> are after:
>
> https://lucene.apache.org/solr/guide/8_1/the-extended-dismax-query-parser.html
>
> The edismax parser also supports the bq and bf parameters from the
> dismax parser:
>
> https://lucene.apache.org/solr/guide/8_1/the-dismax-query-parser.html#bq-boost-query-parameter
>
> Thanks,
> Shawn

Re: qf in conjunction with boost

Posted by Shawn Heisey <ap...@elyograg.org>.
On 6/27/2019 8:54 PM, Mark Sholund wrote:
> qf=title^5 description^5 _text_
> 
> And now I want to include additional boosting based on a popularity 
> score include with some documents. I’ve done this as follows
> 
> q={!boost b=map(popularity_d,0,0,1)}<query terms>
> 
> However now it seems that the score is the same regardless of whether qf 
> is included or not - this renders qf irrelevant to my query.

qf is a parameter for the dismax and edismax query parsers, but your 
query has changed to the boost query parser.  It is very unlikely that 
the boost parser uses the qf parameter.

It looks like using edismax with its "boost" parameter MIGHT be what you 
are after:

https://lucene.apache.org/solr/guide/8_1/the-extended-dismax-query-parser.html

The edismax parser also supports the bq and bf parameters from the 
dismax parser:

https://lucene.apache.org/solr/guide/8_1/the-dismax-query-parser.html#bq-boost-query-parameter

Thanks,
Shawn