You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by rajani m <ra...@gmail.com> on 2024/03/13 16:36:58 UTC

Bury search results with bq

Hi Solr Users,

   How do you bury results based on subquery such as bq=-(keywords:2023)?

Thank you,
Rajani

Re: Bury search results with bq

Posted by Alessandro Benedetti <a....@sease.io>.
It would be interesting to understand the full use case because it feels
like a matching problem rather than a ranking problem (like you don't want
the search result in the first place).

 Given that, shooting in the dark, some options come to my mind:

1) you boost anything else (*:* - something) -> never tested (at least
recently)
2) you use a constant score field:terrible^=-100 -> never tested

Cheers
--------------------------
*Alessandro Benedetti*
Director @ Sease Ltd.
*Apache Lucene/Solr Committer*
*Apache Solr PMC Member*

e-mail: a.benedetti@sease.io


*Sease* - Information Retrieval Applied
Consulting | Training | Open Source

Website: Sease.io <http://sease.io/>
LinkedIn <https://linkedin.com/company/sease-ltd> | Twitter
<https://twitter.com/seaseltd> | Youtube
<https://www.youtube.com/channel/UCDx86ZKLYNpI3gzMercM7BQ> | Github
<https://github.com/seaseltd>


On Wed, 13 Mar 2024 at 17:37, rajani m <ra...@gmail.com> wrote:

> Hi Solr Users,
>
>    How do you bury results based on subquery such as bq=-(keywords:2023)?
>
> Thank you,
> Rajani
>

Re: Bury search results with bq

Posted by Alessandro Benedetti <a....@sease.io>.
It would be interesting to understand the full use case because it feels
like a matching problem rather than a ranking problem (like you don't want
the search result in the first place).

 Given that, shooting in the dark, some options come to my mind:

1) you boost anything else (*:* - something) -> never tested (at least
recently)
2) you use a constant score field:terrible^=-100 -> never tested

Cheers
--------------------------
*Alessandro Benedetti*
Director @ Sease Ltd.
*Apache Lucene/Solr Committer*
*Apache Solr PMC Member*

e-mail: a.benedetti@sease.io


*Sease* - Information Retrieval Applied
Consulting | Training | Open Source

Website: Sease.io <http://sease.io/>
LinkedIn <https://linkedin.com/company/sease-ltd> | Twitter
<https://twitter.com/seaseltd> | Youtube
<https://www.youtube.com/channel/UCDx86ZKLYNpI3gzMercM7BQ> | Github
<https://github.com/seaseltd>


On Wed, 13 Mar 2024 at 17:37, rajani m <ra...@gmail.com> wrote:

> Hi Solr Users,
>
>    How do you bury results based on subquery such as bq=-(keywords:2023)?
>
> Thank you,
> Rajani
>

Re: Bury search results with bq

Posted by rajani m <ra...@gmail.com>.
Thank you all.

Robi, yeah boost instead of bq with less than 1 decimals does it, will just
use boost with function query() and see if that helps.

Alessandro, thank you for those pointers, it is a ranking problem, want to
keep the matches as high as possible and at the same time positively boost
good ones or bury older ones.

Thomas, thank you for looking into this. Looking for a query level, so the
query elevation component won't work but I like that feature.



On Wed, Mar 13, 2024 at 2:23 PM Thomas Corthals <th...@klascement.net>
wrote:

> If you know the IDs of the documents and you want to exclude them entirely
> (not just sort them last), have a look if the Query Elevation Component
> suits your needs.
>
>
> https://solr.apache.org/guide/solr/latest/query-guide/query-elevation-component.html
>
> Thomas
>
> Op wo 13 mrt 2024 om 17:36 schreef rajani m <ra...@gmail.com>:
>
> > Hi Solr Users,
> >
> >    How do you bury results based on subquery such as bq=-(keywords:2023)?
> >
> > Thank you,
> > Rajani
> >
>

Re: Bury search results with bq

Posted by rajani m <ra...@gmail.com>.
Thank you all.

Robi, yeah boost instead of bq with less than 1 decimals does it, will just
use boost with function query() and see if that helps.

Alessandro, thank you for those pointers, it is a ranking problem, want to
keep the matches as high as possible and at the same time positively boost
good ones or bury older ones.

Thomas, thank you for looking into this. Looking for a query level, so the
query elevation component won't work but I like that feature.



On Wed, Mar 13, 2024 at 2:23 PM Thomas Corthals <th...@klascement.net>
wrote:

> If you know the IDs of the documents and you want to exclude them entirely
> (not just sort them last), have a look if the Query Elevation Component
> suits your needs.
>
>
> https://solr.apache.org/guide/solr/latest/query-guide/query-elevation-component.html
>
> Thomas
>
> Op wo 13 mrt 2024 om 17:36 schreef rajani m <ra...@gmail.com>:
>
> > Hi Solr Users,
> >
> >    How do you bury results based on subquery such as bq=-(keywords:2023)?
> >
> > Thank you,
> > Rajani
> >
>

Re: Bury search results with bq

Posted by Thomas Corthals <th...@klascement.net>.
If you know the IDs of the documents and you want to exclude them entirely
(not just sort them last), have a look if the Query Elevation Component
suits your needs.

https://solr.apache.org/guide/solr/latest/query-guide/query-elevation-component.html

Thomas

Op wo 13 mrt 2024 om 17:36 schreef rajani m <ra...@gmail.com>:

> Hi Solr Users,
>
>    How do you bury results based on subquery such as bq=-(keywords:2023)?
>
> Thank you,
> Rajani
>

Re: Bury search results with bq

Posted by Robi Petersen <ro...@gmail.com>.
oh missed your response NM lol

On Wed, Mar 13, 2024 at 9:31 PM Robi Petersen <ro...@gmail.com> wrote:

> ie  I was thinking of it like q=*:*&bq=keywords:2023^0.000001&bq=-keywords:2023^2
> but I'm thinking your way was sufficient. Did that not work?
>
>
> On Wed, Mar 13, 2024 at 10:52 AM Robi Petersen <ro...@gmail.com> wrote:
>
>> Boost factor 0.00001 should do it
>>
>> On Wed, Mar 13, 2024, 9:37 AM rajani m <ra...@gmail.com> wrote:
>>
>>> Hi Solr Users,
>>>
>>>    How do you bury results based on subquery such as bq=-(keywords:2023)?
>>>
>>> Thank you,
>>> Rajani
>>>
>>

Re: Bury search results with bq

Posted by Robi Petersen <ro...@gmail.com>.
ie  I was thinking of it like
q=*:*&bq=keywords:2023^0.000001&bq=-keywords:2023^2
but I'm thinking your way was sufficient. Did that not work?


On Wed, Mar 13, 2024 at 10:52 AM Robi Petersen <ro...@gmail.com> wrote:

> Boost factor 0.00001 should do it
>
> On Wed, Mar 13, 2024, 9:37 AM rajani m <ra...@gmail.com> wrote:
>
>> Hi Solr Users,
>>
>>    How do you bury results based on subquery such as bq=-(keywords:2023)?
>>
>> Thank you,
>> Rajani
>>
>

Re: Bury search results with bq

Posted by Robi Petersen <ro...@gmail.com>.
Boost factor 0.00001 should do it

On Wed, Mar 13, 2024, 9:37 AM rajani m <ra...@gmail.com> wrote:

> Hi Solr Users,
>
>    How do you bury results based on subquery such as bq=-(keywords:2023)?
>
> Thank you,
> Rajani
>