Skip to content

Commit

Permalink
fix: add collection usage_key to index
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Sep 14, 2024
1 parent e6ca2c1 commit b455881
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions openedx/core/djangoapps/content/search/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b455881

Please sign in to comment.