[DISCO-3809] Establish a common Elasticsearch adapter for providers and jobs #1259
+878
−187
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.
References
JIRA: DISCO-3809
Description
This PR introduces a common Elasticsearch adapter. As more components rely on Elasticsearch, we want to standardize how clients are initialized and how common operations (index lifecycle, bulk, search, etc.) are handled, while still leaving room for future flexibility.
Direction
We are keeping the Elasticsearch adapter configurable, allowing it to be initialized with an arbitrary DSN and API key. If Merino providers and jobs are using the same Elasticsearch cluster, the intended direction is that they should also use a shared credential set (DSN + API key), rather than defining provider-specific credentials. We may need to distinguish read vs write access (e.g., separate API keys). We can confirm if we do, but the goal is to keep the number of credentials small and well-defined.
As a follow-up, we plan to:
This approach allows us to:
Followup
PR Review Checklist
Put an
xin the boxes that apply[DISCO-####], and has the same title (if applicable)[load test: (abort|skip|warn)]keywords are applied to the last commit message (if applicable)┆Issue is synchronized with this Jira Task