From 46fff0758d264ca9a8383e5449d3940bc0cff11b Mon Sep 17 00:00:00 2001 From: shankar ambady Date: Fri, 22 Nov 2024 15:05:33 -0500 Subject: [PATCH] returnning all resource types for similar --- learning_resources_search/api.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/learning_resources_search/api.py b/learning_resources_search/api.py index 8c6ee6fb01..bfc7dd84f4 100644 --- a/learning_resources_search/api.py +++ b/learning_resources_search/api.py @@ -1043,12 +1043,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())}],