Full text search set to english

This commit is contained in:
Christoph Haas 2014-12-29 20:14:41 +01:00
parent bb3d390681
commit 3f1ec0b202

View file

@ -3,7 +3,11 @@ class Package < ActiveRecord::Base
# https://github.com/Casecommons/pg_search
include PgSearch
# TODO: Make search weighted on users' rating
pg_search_scope :general_search, :against => [:name, :description, :long_description]
pg_search_scope :general_search,
:against => [:name, :description, :long_description],
:using => {
:tsearch => {:dictionary => "english"}
}
# I am using "destroy_all" here so that when a package gets destroys the
# callbacks for all dependent screenshots are executed - thus removing the