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,10 +9,10 @@ class PaperSearch < ActiveRecord::Base
|
||||||
Elasticsearch::DSL::Search.search do
|
Elasticsearch::DSL::Search.search do
|
||||||
|
|
||||||
sort do
|
sort do
|
||||||
if options[:sort_by] == 'date'
|
if options[:sort_by] == 'score'
|
||||||
by :published_at, order: 'desc'
|
by '_score'
|
||||||
end
|
end
|
||||||
by '_score'
|
by :published_at, order: 'desc'
|
||||||
end
|
end
|
||||||
|
|
||||||
query do
|
query do
|
||||||
|
|
Loading…
Reference in a new issue