[SDBELGA-1056] Add get_all_batch_elastic to Eve resource service#3172
Merged
MarkLark86 merged 5 commits intosuperdesk:release/2.11from Mar 18, 2026
Merged
[SDBELGA-1056] Add get_all_batch_elastic to Eve resource service#3172MarkLark86 merged 5 commits intosuperdesk:release/2.11from
get_all_batch_elastic to Eve resource service#3172MarkLark86 merged 5 commits intosuperdesk:release/2.11from
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Elasticsearch-backed batch iterator to the Eve resource service to support efficient full-index iteration without using from/to pagination.
Changes:
- Introduced
get_all_batch_elastic()on the resource service usingsearch_afterpagination. - Added a raw-search path (
search_raw) in the Eve backend to bypass resource-specific filters when needed. - Added datalayer tests covering batch iteration and query filtering via Elasticsearch.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| tests/datalayer_tests.py | Adds tests for the new get_all_batch_elastic batch iterator (including lookup filtering). |
| superdesk/services.py | Implements get_all_batch_elastic() using Elasticsearch search_after pagination. |
| superdesk/eve_backend.py | Adds search_raw() to access the Elasticsearch backend without resource-specific filtering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
petrjasek
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
We didn't have a way to iterate, in batches, items in Elasticsearch. The only way to do it was manually, and using the
fromandtoparams (which is not advisable on large indexes). The current workaround for the ProdAPI/Events endpoint is to usesize=10_000which is not ideal.What has changed
get_all_batch_elasticto the Eve resource serviceResolves: SDBELGA-1056