mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2024-12-22 23:53:15 +01:00
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
This commit is contained in:
parent
0718e86f07
commit
5ef5975ad7
1 changed files with 3 additions and 3 deletions
|
@ -9,11 +9,11 @@ class PaperSearch < ActiveRecord::Base
|
|||
Elasticsearch::DSL::Search.search do
|
||||
|
||||
sort do
|
||||
if options[:sort_by] == 'date'
|
||||
by :published_at, order: 'desc'
|
||||
end
|
||||
if options[:sort_by] == 'score'
|
||||
by '_score'
|
||||
end
|
||||
by :published_at, order: 'desc'
|
||||
end
|
||||
|
||||
query do
|
||||
# search query
|
||||
|
|
Loading…
Reference in a new issue