Method: Sunspot::CompositeSetup#field

Defined in:
lib/sunspot/composite_setup.rb

#field(field_name) ⇒ Object

Get a Sunspot::AttributeField instance corresponding to the given field name

Parameters

field_name<Symbol>

The public field name for which to find a field

Returns

Sunspot::AttributeField The field object corresponding to the given name

Raises

ArgumentError

If the given field name is not configured for the types being queried



74
75
76
77
78
79
# File 'lib/sunspot/composite_setup.rb', line 74

def field(field_name) #:nodoc:
  fields_hash[field_name.to_sym] || raise(
    UnrecognizedFieldError,
    "No field configured for #{@types * ', '} with name '#{field_name}'"
  )
end