Skip to content

Conversation

@shanbady
Copy link
Contributor

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?

  1. checkout main
  2. backpopulate mit climate articles via python manage.py backpopulate_mit_climate_articles
  3. recreate the opensearch index python manage.py recreate_index --all
  4. go to your local opensearch indexes and note that the article index is empty/has 0 records
  5. checkout this branch
  6. restart celery
  7. repeat the steps and note that it is populated

You 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.

@shanbady shanbady added the Needs Review An open Pull Request that is ready for review label Nov 12, 2025
@shanbady shanbady changed the title ensure re-indexing for all non-course resources Ensure re-indexing and re-embedding operations include all non-course learning resource types Nov 13, 2025
@shanbady shanbady marked this pull request as ready for review November 13, 2025 03:53
@mbertrand mbertrand self-assigned this Nov 13, 2025
Copy link
Member

@mbertrand mbertrand left a comment

Choose a reason for hiding this comment

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

👍

@mbertrand mbertrand added Waiting on author and removed Needs Review An open Pull Request that is ready for review labels Nov 13, 2025
@shanbady shanbady merged commit 923bcb7 into main Nov 13, 2025
18 of 19 checks passed
@shanbady shanbady deleted the shanbady/add-article-indexes branch November 13, 2025 20:39
@odlbot odlbot mentioned this pull request Nov 17, 2025
16 tasks
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.

3 participants