Method: Sunspot::CompositeSetup#dynamic_field_factory

Defined in:
lib/sunspot/composite_setup.rb

#dynamic_field_factory(field_name) ⇒ Object

Get a dynamic field factory for the given base name.

Returns

DynamicFieldFactory

Factory for dynamic fields with the given base name

Raises

UnrecognizedFieldError

If the given base name is not configured as a dynamic field for the types being queried



93
94
95
96
97
98
# File 'lib/sunspot/composite_setup.rb', line 93

def dynamic_field_factory(field_name)
  dynamic_field_factories_hash[field_name.to_sym] || raise(
    UnrecognizedFieldError,
    "No dynamic field configured for #{@types * ', '} with name #{field_name.inspect}"
  )
end