Ensure re-indexing and re-embedding operations include all non-course learning resource types #2695
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.
What are the relevant tickets?
Closes https://github.com/mitodl/hq/issues/9233
Description (What does it do?)
This PR resolves (and prevents something similar from happening moving forward) an issue where the newly added Article learning resource type was not being indexed or updated during recreate_index and update_index operations in both vector search and learning_resources search apps. There are places where we hardcode a list of non-course resource type which should actually just be automatically derived from LEARNING_RESOURCE_TYPES constant.
How can this be tested?
python manage.py backpopulate_mit_climate_articlespython manage.py recreate_index --allYou can also see this behavior with the update_index command as well as the generate_embeddings management command
Additional notes
The reason this is not an issue on our live instances is that the the missing content types still get added to the index upon insertion so this only affected recreation and updates to the entire index.