Module: SearchMagic::FullTextSearch

Extended by:
ActiveSupport::Concern
Defined in:
lib/search_magic/full_text_search.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#values_matching(pattern) ⇒ Object



132
133
134
135
136
137
# File 'lib/search_magic/full_text_search.rb', line 132

def values_matching(pattern)
  options, pattern = self.class.strip_option_terms_from(pattern)
  terms = self.class.terms_for(pattern)
  r = Regexp.union(*terms)
  searchable_values.grep(r)
end