Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Results pagination support in pyserini #1814

Open
bevankoopman opened this issue Mar 12, 2024 · 2 comments
Open

Results pagination support in pyserini #1814

bevankoopman opened this issue Mar 12, 2024 · 2 comments

Comments

@bevankoopman
Copy link

How does one do results pagination in pyersini? (There is support for this in Elastic which I thought it might inherit from Lucene itself but I didn't find anything online re pyserini.)

To be clear, by pagination I mean the following situation:

  • Issue a query with the backend determining the ranking of document ids; but document content is only populated for top k results (page 1 being 0...k);
  • First page of results returned to client;
  • Client can then issue the same query asking for page 2 with backend returning documents with contents for k...2k (page 2)
  • And so on...

The main purpose being to avoid the latency of having to lost documents contents for long result list, especially if the user never looks beyond page 1 of results.

Is there support for this or do we have to build it ourselves?

Thanks!

@bevankoopman
Copy link
Author

Any update / thoughts in how to do this?

@lintool
Copy link
Member

lintool commented Mar 21, 2024

Hi @bevankoopman - unfortunately, this isn't a feature that's supported in Pyserini right now... so, yea, you'll have to roll it yourself...

How deep into the ranked list are you planning to go? I haven't looked into the implementation in Elasticsearch, but in terms of methods associated with IndexSearcher [1] I don't see any obvious paging support... so I wonder how Elasticsearch implements it...

[1] https://lucene.apache.org/core/9_10_0/core/org/apache/lucene/search/IndexSearcher.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants