lib/georgia/indexer/solr/ckeditor/asset.rb in georgia-0.7.2 vs lib/georgia/indexer/solr/ckeditor/asset.rb in georgia-0.7.3
- old
+ new
@@ -19,12 +19,25 @@
time :updated_at
integer :size, stored: true do
size / 1024 # gives size in KB
end
end
+
+ def self.search_index model, params
+ @search = model.search do
+ fulltext params[:query] do
+ fields(:filename, :tags)
+ end
+ with(:extension, params[:e]) unless params[:e].blank?
+ with(:tags).any_of(params[:tg]) unless params[:tg].blank?
+ order_by (params[:o] || :updated_at), (params[:dir] || :desc)
+ paginate(page: params[:page], per_page: (params[:per] || 8))
+ end
+ end
end
end
end
end
end
end
-end
\ No newline at end of file
+end
+