Module: Sphinxsearchlogic::Search::Ordering

Included in:
Sphinxsearchlogic::Search
Defined in:
lib/sphinxsearchlogic.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#orderObject

Returns the value of attribute order.



95
96
97
# File 'lib/sphinxsearchlogic.rb', line 95

def order
  @order
end

#order_attributeObject (readonly)

Returns the value of attribute order_attribute.



95
96
97
# File 'lib/sphinxsearchlogic.rb', line 95

def order_attribute
  @order_attribute
end

#order_directionObject (readonly)

Returns the value of attribute order_direction.



95
96
97
# File 'lib/sphinxsearchlogic.rb', line 95

def order_direction
  @order_direction
end

Instance Method Details

#ordering_optionsObject



114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/sphinxsearchlogic.rb', line 114

def ordering_options
  if order_attribute.blank?
    {}
  elsif order_attribute.is_a?(Symbol)
    {
      :order => order_attribute,
      :sort_mode => order_direction
    }
  else
    {:order => order_attribute}
  end
end