def index(*params, &block)
      index_field = IndexField.new(params, block)

      add_index_field(index_field)

      # Create the attribute finder method
      define_finder index_field[:finder_name]
    end
def index(*params, &block)
      index_field = IndexField.new(params, block)

      add_index_field(index_field)

      # Create the attribute finder method
      define_finder index_field[:finder_name]
    end
Macro for defining a class attribute as an indexed field.

 Also creates the corresponding attribute finder method, which defaults
 to the field name. This can be defined with the
 :finder_name => "anothername" option.

 Refer to {IndexField} for more information on defining fields.