Skip to content

Commit

Permalink
Sort by score
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 27, 2017
1 parent 159fa6f commit 96c261e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/controllers/documents_controller.rb
Expand Up @@ -15,8 +15,12 @@ def index
"tags.label",
"highlight_html(title)",
"snippet_html(content)",
]).
query(@query)
])
if @query.present?
request = request.
query(@query).
sort_keys(["-_score"])
end
if @tag.present?
request = request.filter("tags @ %{tag}", tag: @tag)
end
Expand Down

0 comments on commit 96c261e

Please sign in to comment.