Class: Sunspot::Query::FulltextBaseQuery

Inherits:
BaseQuery
  • Object
show all
Defined in:
lib/sunspot/query/fulltext_base_query.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(keywords, options, types, setup) ⇒ FulltextBaseQuery

Returns a new instance of FulltextBaseQuery.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/sunspot/query/fulltext_base_query.rb', line 4

def initialize(keywords, options, types, setup)
  super(types, setup)
  @keywords = keywords

  if highlight_options = options.delete(:highlight)
    set_highlight(highlight_options == true ? [] : highlight_options)
  end

  if fulltext_fields = options.delete(:fields)
    Array(fulltext_fields).each do |field|
      add_fulltext_field(field)
    end
  end
end