Class: Sunspot::Query::FieldFunctionQuery

Inherits:
FunctionQuery show all
Defined in:
lib/sunspot/query/function_query.rb

Overview

Function query which represents a field.

Instance Attribute Summary collapse

Attributes inherited from FunctionQuery

#boost_amount

Instance Method Summary collapse

Methods inherited from FunctionQuery

#^

Constructor Details

#initialize(field) ⇒ FieldFunctionQuery

Returns a new instance of FieldFunctionQuery.



44
45
46
# File 'lib/sunspot/query/function_query.rb', line 44

def initialize(field)
  @field = field
end

Instance Attribute Details

#fieldObject (readonly)

Returns the value of attribute field.



42
43
44
# File 'lib/sunspot/query/function_query.rb', line 42

def field
  @field
end

Instance Method Details

#==(other) ⇒ Object



52
53
54
# File 'lib/sunspot/query/function_query.rb', line 52

def ==(other)
  super and @field == other.field
end

#to_sObject



48
49
50
# File 'lib/sunspot/query/function_query.rb', line 48

def to_s
  "#{Util.escape(@field.indexed_name)}" << (@boost_amount ? "^#{@boost_amount}" : "")
end