-
Notifications
You must be signed in to change notification settings - Fork 50
Make the index names configurable using env vars #712
Conversation
configuration
module
API Developer Docs Preview: Ready https://wordpress.github.io/openverse-api/_preview/712 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the goal behind this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@sarayourfriend since we will be using versioned indices we might have more than one index of each media type in the Elasticsearch store (during transition periods). This PR allows us to keep those changes in the environment instead of modifying the code everytime there is a new index version. |
Based on the medium urgency of this PR, the following reviewers are being This reminder is being automatically generated due to the urgency configuration. @dhruvkb, if this PR is not ready for a review, please draft it to prevent reviewers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I'm going to merge this. This is backwards-compatible as it defaults to the media type when the env vars are not defined. |
In #712 Elasticsearch configuration was moved out of the search controller area into the Django settings module. This unifies access to ES from across the application and is part of the refactoring being done to support the ES versioned index, multi-stage deployment. This commit keeps those changes and applies them to the old search_controller.py module that did not exist at the time the configuration change was applied.
In #712 Elasticsearch configuration was moved out of the search controller area into the Django settings module. This unifies access to ES from across the application and is part of the refactoring being done to support the ES versioned index, multi-stage deployment. This commit keeps those changes and applies them to the old search_controller.py module that did not exist at the time the configuration change was applied.
* Revert "Fix related media endpoint (#808)" This reverts commit d7962f1. * Selectively revert "Add logging and fix all logging contexts (#790)" This reverts commit ce33572. * Revert "Refactor search controller for consistency and clarity (#778)" Preserves #730 This reverts commit d26df92. * Fix divergent Elasticsearch configurations In #712 Elasticsearch configuration was moved out of the search controller area into the Django settings module. This unifies access to ES from across the application and is part of the refactoring being done to support the ES versioned index, multi-stage deployment. This commit keeps those changes and applies them to the old search_controller.py module that did not exist at the time the configuration change was applied. * Lint * Prevent circular import We can replace the Any back with the serializer type in the future. * Add back related media endpoint integration tests * Lint
Description
This PR provides the mechanism to set the index mappings for the media types using environment variables. If not set, they will default to the name of the media type (which is the current configuration).
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin