From b45588173f1be4fecc50acb99deff6ea5235b322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Penido?= Date: Fri, 13 Sep 2024 21:25:31 -0300 Subject: [PATCH] fix: add collection usage_key to index --- openedx/core/djangoapps/content/search/documents.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openedx/core/djangoapps/content/search/documents.py b/openedx/core/djangoapps/content/search/documents.py index 1c587b81612e..5e7272079551 100644 --- a/openedx/core/djangoapps/content/search/documents.py +++ b/openedx/core/djangoapps/content/search/documents.py @@ -384,9 +384,15 @@ def searchable_doc_for_collection(collection) -> dict: like Meilisearch or Elasticsearch, so that the given collection can be found using faceted search. """ + usage_key = lib_api.get_library_collection_usage_key( + library_key=LibraryLocatorV2.from_string(collection.learning_package.key), + collection_key=collection.key, + ) + doc = { Fields.id: collection.id, Fields.block_id: collection.key, + Fields.usage_key: str(usage_key), Fields.type: DocType.collection, Fields.display_name: collection.title, Fields.description: collection.description,