From 5ef5975ad70409e8f9d35b7a9d762de74787a38a Mon Sep 17 00:00:00 2001 From: Joerg Reichert Date: Sat, 26 Mar 2016 13:40:39 +0100 Subject: [PATCH] by default sort by published date, as initial web site shows all papers and thus there is no query yet that can be sorted by relevance --- app/models/paper_search.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/paper_search.rb b/app/models/paper_search.rb index 1f99a1c..96a40d1 100644 --- a/app/models/paper_search.rb +++ b/app/models/paper_search.rb @@ -9,10 +9,10 @@ class PaperSearch < ActiveRecord::Base Elasticsearch::DSL::Search.search do sort do - if options[:sort_by] == 'date' - by :published_at, order: 'desc' + if options[:sort_by] == 'score' + by '_score' end - by '_score' + by :published_at, order: 'desc' end query do