Skip to content

Commit

Permalink
[#714] Use score not relevance in default sort order
Browse files Browse the repository at this point in the history
'relevance' is not actually in the solr schema so it doesn't do
anything, score is the one we want.
  • Loading branch information
Sean Hammond committed Apr 16, 2013
1 parent 7fc81b1 commit 14690e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ckan/logic/action/get.py
Expand Up @@ -1235,7 +1235,7 @@ def package_search(context, data_dict):
abort = data_dict.get('abort_search',False)

if data_dict.get('sort') in (None, 'rank'):
data_dict['sort'] = 'relevance asc, metadata_modified desc'
data_dict['sort'] = 'score desc, metadata_created desc'

results = []
if not abort:
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/snippets/sort_by.html
Expand Up @@ -11,7 +11,7 @@
<span class="form-select control-group control-order-by">
<label for="field-order-by">{{ _('Order by') }}</label>
<select id="field-order-by" name="sort">
<option value="relevance asc, metadata_modified desc"{% if sort =='relevance asc, metadata_modified desc' %} selected="selected"{% endif %}>{{ _('Relevance') }}</option>
<option value="score desc, metadata_modified desc"{% if sort =='score desc, metadata_modified desc' %} selected="selected"{% endif %}>{{ _('Relevance') }}</option>
<option value="title_string asc"{% if sort=='title_string asc' %} selected="selected"{% endif %}>{{ _('Name Ascending') }}</option>
<option value="title_string desc"{% if sort=='title_string desc' %} selected="selected"{% endif %}>{{ _('Name Descending') }}</option>
<option value="metadata_modified desc"{% if sort=='metadata_modified desc' %} selected="selected"{% endif %}>{{ _('Last Modified') }}</option>
Expand Down

0 comments on commit 14690e4

Please sign in to comment.