diff --git a/django/core/jinja2/common.jinja b/django/core/jinja2/common.jinja index 40bdd2ee7..0d1f95560 100644 --- a/django/core/jinja2/common.jinja +++ b/django/core/jinja2/common.jinja @@ -170,7 +170,7 @@ {{ term }} {% endfor %} - clear + clear filters {% endif %}
diff --git a/django/library/views.py b/django/library/views.py index 93589f3ee..26d9404a3 100644 --- a/django/library/views.py +++ b/django/library/views.py @@ -398,6 +398,10 @@ def filter_queryset(self, request, queryset, view): criteria.update(id__in=filtered_codebase_ids) if ordering: criteria.update(ordering=ordering) + else: + if qs: + # set default ordering for search when ordering is not specified + criteria.update(ordering="relevance") return get_search_queryset(qs, queryset, tags=tags, criteria=criteria) diff --git a/frontend/src/components/CodebaseListSidebar.vue b/frontend/src/components/CodebaseListSidebar.vue index f20ef351e..19a30ac2c 100644 --- a/frontend/src/components/CodebaseListSidebar.vue +++ b/frontend/src/components/CodebaseListSidebar.vue @@ -25,10 +25,8 @@ -