sunspot install

This commit is contained in:
Andreas Stephanides
2014-10-26 17:44:19 +01:00
parent 3a8f84d9b4
commit a41f964a84
7 changed files with 53 additions and 9 deletions

View File

@@ -32,7 +32,7 @@ class Neuigkeit < ActiveRecord::Base
scope :public, ->{includes(:rubrik).where("rubriken.public"=>true)}
scope :intern, ->{includes(:rubrik).where("rubriken.public"=>false)}
scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")}
# scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")}
LINKTYPES=["Thema", "Gallery", "Lva","Studium","Fetprofile", "Gremium"]
accepts_nested_attributes_for :calentries, :allow_destroy=>true , :reject_if=> lambda{|a| a[:start].blank?}
before_validation :sanitize
@@ -83,4 +83,8 @@ class Neuigkeit < ActiveRecord::Base
calentry.object=self
end
end
searchable do
text :text, :datum
text :title, :boost=>3.0
end
end