Hi,
what do you mean by "The
rows parameter is being overwritten by the topK parameter" ?

The knn query parser builds a Lucene query that returns topK results max.
This means that if you set rows>topK, you will get topK results, it's
expected, it's how it works.
If you want more results, you need to change the topK.
N.B. running topk=10 or topk=100 has probabilistic factors involved, so I
don't think the top10 will be the same, would need to double check,
unfortunately I don't have time now.

Pagination is a separate component and should work with no problem with the
knn query parser.

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

e-mail: a.benede...@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 Tue, 7 Jan 2025 at 21:25, Guruprasad Choukimath <
choukimath.gurupra...@gmail.com> wrote:

> Hello,
>
> I am trying to construct a hybrid search query using BoolQParser, referring
> to the article:
> https://sease.io/2023/12/hybrid-search-with-apache-solr.html
> .
>
> Our application has a pagination setup that users rely on to retrieve
> results. While the pagination works well with the edismax parser using the
> rows attribute, we're experiencing an issue when using BoolQParser. The
> rows parameter is being overwritten by the topK parameter from the knn
> query.
>
> Here's my current query:
>
> {!bool should="{!edismax qf='title_desc'}generative ai" should="{!knn
> f=title_desc_vector topK=20}[{{vector}}]"}
>
> Is there a way to implement pagination with knn parser, specifically for
> this type of query?
>
> Thank you for your help.
>

Reply via email to