Skip to content

Commit b455881

Browse files
committed
fix: add collection usage_key to index
1 parent e6ca2c1 commit b455881

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

openedx/core/djangoapps/content/search/documents.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,15 @@ def searchable_doc_for_collection(collection) -> dict:
384384
like Meilisearch or Elasticsearch, so that the given collection can be
385385
found using faceted search.
386386
"""
387+
usage_key = lib_api.get_library_collection_usage_key(
388+
library_key=LibraryLocatorV2.from_string(collection.learning_package.key),
389+
collection_key=collection.key,
390+
)
391+
387392
doc = {
388393
Fields.id: collection.id,
389394
Fields.block_id: collection.key,
395+
Fields.usage_key: str(usage_key),
390396
Fields.type: DocType.collection,
391397
Fields.display_name: collection.title,
392398
Fields.description: collection.description,

0 commit comments

Comments
 (0)