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

Elasticsearch - refactor _search_documents #57

Merged
merged 23 commits into from
Nov 20, 2023
Merged

Conversation

anakin87
Copy link
Member

@anakin87 anakin87 commented Nov 16, 2023

The method _search_documents was created to properly manage calls to the Elasticsearch client's search method and handle pagination. It also avoids code duplication.

Changes

  • improve this method, making it consider the top_k value if present (to stop iterating)
  • introduce it in _bm25_retrieval
  • add tests for retrieval with pagination, where this method plays a key role

@anakin87 anakin87 requested a review from a team as a code owner November 16, 2023 17:29
@anakin87 anakin87 requested review from julian-risch and removed request for a team November 16, 2023 17:29
@anakin87 anakin87 changed the title Use the internal method _search_documents in _bm25_retrieval Elasticsearch - use the internal method _search_documents in _bm25_retrieval Nov 16, 2023
@anakin87 anakin87 marked this pull request as draft November 16, 2023 17:41
@anakin87 anakin87 changed the title Elasticsearch - use the internal method _search_documents in _bm25_retrieval Elasticsearch - refactor _search_documents Nov 17, 2023
@anakin87 anakin87 self-assigned this Nov 17, 2023
@anakin87 anakin87 marked this pull request as ready for review November 17, 2023 17:53
@anakin87 anakin87 marked this pull request as draft November 20, 2023 11:10
@anakin87 anakin87 marked this pull request as ready for review November 20, 2023 11:18
Copy link
Contributor

@silvanocerza silvanocerza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go go! 🚀

@anakin87 anakin87 merged commit 1c6410e into main Nov 20, 2023
4 checks passed
@anakin87 anakin87 deleted the es-refactor-bm25-retrieval branch November 20, 2023 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants