-
Notifications
You must be signed in to change notification settings - Fork 7
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
Store Collection metadata + component count in meilisearch #684
Store Collection metadata + component count in meilisearch #684
Conversation
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.
This is looking good @pomegranited!
Some issues from openedx#35469 will also affect here, though.
update_library_collection_index_doc.delay( | ||
str(library_collection.library_key), | ||
library_collection.collection_key, | ||
) |
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 need to make these events sync so the frontend is updated as soon as we make a change in the search index.
update_library_collection_index_doc.delay( | |
str(library_collection.library_key), | |
library_collection.collection_key, | |
) | |
api.upsert_library_collection_index_doc(library_collection.library_key, library_collection.collection_key) |
A bit more context here: openedx#35367 (comment)
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.
Done with 2c6c8cf.
to update the index before the frontend re-fetches
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 @pomegranited 👍
Thank you for your work here!
Description
This PR makes several enhancements related to how Collections are indexed in the Studio Search app.
LIBRARY_COLLECTION_CREATED
/LIBRARY_COLLECTION_UPDATED
events and adds/updates the collection document in the Studio content search index.block_id
field. This key + the library_key is required for accessing the Collection REST APIs.num_children
. Collections store the number of entities in the collection.Future PRs may store XBlock children counts here.
Libraries v2 is not used in production by default yet, so this change shouldn't affect any current users.
Supporting information
Related to openedx/frontend-app-authoring#1260
Based on openedx#35469
Private-ref: FAL-3787
Testing instructions
Set up tutor:
tutor dev run cms python manage.py migrate
tutor dev run cms ./manage.py cms reindex_studio --experimental
to add the new fields.In the content-authoring MFE:
lib:SampleTaxonomyOrg1:AL1
Hint: you can retrieve the block keys using the REST API, e.g. http://studio.local.edly.io:8001/api/libraries/v2/lib:SampleTaxonomyOrg1:AL1/blocks/
In the shell
tutor dev run cms python manage.py cms shell
, add blocks to the collection:In meilisearch http://meilisearch.local.edly.io:7700:
tutor config printvalue MEILISEARCH_API_KEY
id = collection.id
(unique)block_id = collection.key
num_children = <number of blocks in the collection>
Deadline
Before Sumac gets cut in October.