-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat: Improved Meilisearch Index upgrade workflow #37627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| api.rebuild_index(self.stdout.write, incremental=True) | ||
| else: | ||
| api.rebuild_index(self.stdout.write) | ||
| api.rebuild_index.delay() |
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.
How will the administrator know when it's done?
| ) | ||
| def test_reindex_meilisearch_collection_error(self, mock_meilisearch) -> None: | ||
|
|
||
| mock_logger = Mock() |
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.
You can delete this mock and the related assertion below if we're not using it anymore. Same in the next test.
| # Changing them on a populated index will "re-index all documents in the index", which can take some time | ||
| # and use more RAM. Instead, we configure an empty index then populate it one course/library at a time. | ||
| if not incremental: | ||
| _configure_index(index_name) |
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.
We still need to call _configure_index I think. We need something like this:
if not _is_index_configured(STUDIO_INDEX_NAME):
if should_reset: # Was --reset passed? Delete the whole index and start over
reset_index()
elif (# of documents in index < 2_000) or in_place: # Did user specify --in-place?
_configure_index() # Change the index in place. May be slow if it's populated with lots of data!
else:
raise Error("The index needs to be migrated to the newer format. Pass --reset to delete all index data and rebuild the index from scratch, or --in-place to update the index configuration in place (may take a long time and slow down search results in the meantime).")Although if we test this with a large dataset and find that the "in place" is always faster than rebuilding the whole index, we should just do that automatically, and this can be significantly simplified.
| # and use more RAM. Instead, we configure an empty index then populate it one course/library at a time. | ||
| if not incremental: | ||
| _configure_index(index_name) | ||
| with nullcontext(STUDIO_INDEX_NAME) as index_name: |
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.
You can just remove this whole line/context.
Description
This PR is for issue 36868.
Features:
rebuild_studio.Testing instructions
Enable
MEILISEARCH_ENABLEDlocally.Add
openedx.core.djangoapps.meilisearchin installed apps.