Class: Sunspot::DSL::Fields

Inherits:
Object
  • Object
show all
Defined in:
lib/sunspot_plus/dsl/fields.rb

Instance Method Summary collapse

Instance Method Details

#sort_fields(*names, &block) ⇒ Object

NOTE : I want to call case_insensitive_sort using method missing but with adjusted name Could use adjust_solr_params but not sure about this method.



6
7
8
9
10
11
12
# File 'lib/sunspot_plus/dsl/fields.rb', line 6

def sort_fields(*names, &block)
  options = names.last.is_a?(Hash) ? names.pop : {} 
  names.each do |name|
    field_options = {:using => name}.update(options)
    case_insensitive_sort( Sunspot::Type::CaseInsensitiveSortType.instance.field_name(name), field_options, &block)      
  end
end