class Mongoid::Giza::Index::Field

Represents a Sphinx indexed field

Attributes

attribute[RW]
block[RW]
name[R]

Public Class Methods

new(name, attribute = nil, &block) click to toggle source

Creates a full-text field with a name and an optional block

If a block is given then it will be evaluated for each instance of the

class being indexed

and the resulting string will be the field value. Otherwise the field value will be the value of the corresponding

object field

@param name [Symbol] the name of the field @param attribute [TrueClass, FalseClass] whether this field will also

be stored as an string attribute

@param block [Proc] an optional block to be evaluated at the scope of

the document on index creation
# File lib/mongoid/giza/index/field.rb, line 24
def initialize(name, attribute = nil, &block)
  @name = normalize(name)
  @attribute = attribute
  @block = block
end