Skip to content

Commit

Permalink
returnning all resource types for similar (#1849)
Browse files Browse the repository at this point in the history
  • Loading branch information
shanbady authored Nov 26, 2024
1 parent c515186 commit 269f58e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions learning_resources_search/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,12 +1041,11 @@ def get_similar_resources_opensearch(
list of str:
list of learning resources
"""
indexes = relevant_indexes([COURSE_TYPE], [], endpoint=LEARNING_RESOURCE)
indexes = relevant_indexes(LEARNING_RESOURCE_TYPES, [], endpoint=LEARNING_RESOURCE)
search = Search(index=",".join(indexes))
if num_resources:
# adding +1 to num_resources since we filter out existing resource.id
search = search.extra(size=num_resources + 1)
search = search.filter("term", resource_type=COURSE_TYPE)
search = search.query(
MoreLikeThis(
like=[{"doc": value_doc, "fields": list(value_doc.keys())}],
Expand Down

0 comments on commit 269f58e

Please sign in to comment.