Replace direct ES access with elasticsearch-model

This commit is contained in:
Andreas Haller 2015-04-27 21:26:37 +02:00
parent 5a07703166
commit 973af9f0d9
5 changed files with 18 additions and 9 deletions

View file

@ -1,9 +1,8 @@
class SearchController < ApplicationController
def index
@result = if params[:q].present?
es = Elasticsearch::Client.new
# TODO: Add pagination
es.search index: 'loris', q: params[:q], size: 30
Paper.search(params[:q]).records
end
end
end