Module: Enjoy::Search::Searchable::ClassMethods

Defined in:
app/models/concerns/enjoy/search/searchable.rb

Instance Method Summary collapse

Instance Method Details

#enjoy_search_fts_index(*opts) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/models/concerns/enjoy/search/searchable.rb', line 5

def enjoy_search_fts_index(*opts)
  if Enjoy::Search.mongoid?
    opts = opts.extract_options!
    index(
      {
        name: "text"
      }.merge(opts[:fields]),
      {
        default_language: opts[:default_language] || "russian",
        weights: {
          name: 100
        }.merge(opts[:weights]),
        name: opts[:name]
      }
    )
  end
end