From 5126b7b175cd257a77ba1a3d63cfe71ba6969f9e Mon Sep 17 00:00:00 2001 From: Anastasia Beglova Date: Wed, 2 Oct 2024 15:06:28 -0400 Subject: [PATCH] add is_incomplete_or_stale to default sort --- learning_resources_search/api.py | 7 ++++++- learning_resources_search/api_test.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/learning_resources_search/api.py b/learning_resources_search/api.py index f6e08a07d1..9ebc5a0a67 100644 --- a/learning_resources_search/api.py +++ b/learning_resources_search/api.py @@ -40,7 +40,12 @@ LEARN_SUGGEST_FIELDS = ["title.trigram", "description.trigram"] COURSENUM_SORT_FIELD = "course.course_numbers.sort_coursenum" -DEFAULT_SORT = ["featured_rank", "is_learning_material", "-created_on"] +DEFAULT_SORT = [ + "featured_rank", + "is_learning_material", + "is_incomplete_or_stale", + "-created_on", +] def gen_content_file_id(content_file_id): diff --git a/learning_resources_search/api_test.py b/learning_resources_search/api_test.py index 86b810113b..08db0a34d1 100644 --- a/learning_resources_search/api_test.py +++ b/learning_resources_search/api_test.py @@ -2696,6 +2696,7 @@ def test_document_percolation(opensearch, mocker): [ "featured_rank", "is_learning_material", + "is_incomplete_or_stale", {"created_on": {"order": "desc"}}, ], ),