class Ferret::Field

See BoostMixin.
the Field class you can just include the BoostMixin in the Array class.
Note: If you’d like to use boosted fields without having to use
match in the :contents field.
matches that match in the :title field score more highly than matches that
boosted field. You may, for example, want to boost a title field so that
you can increase the score of a match for queries that match terms in a
The boost attribute makes a field more important in the index. That is,
=== Boost
#to_s method.
boost attribute. It also provides pretty printing of the field with the
A Field is a section of a Document. A Field is basically an array with a

def +(o)

def +(o)
  return Field.new(super(o), self.boost)
end

def eql?(o)

def eql?(o)
  return (o.is_a? Field and (o.boost == @boost) and super(o))
end

def initialize(data = [], boost = 1.0)

f = Field.new("field data", 1000.0)

Of course Fields can also be boosted;

f = Field.new(["this", "is", "an", "array", "of", "field", "data"])

or as an array of strings;

f = Field.new("This is the fields data")

string;
Create a new Field object. You can pass data to the field as either a
def initialize(data = [], boost = 1.0)
  @boost = boost
  if data.is_a? Array
    data.each {|v| self << v}
  else
    self << data.to_s
  end
end

def to_s

def to_s
  buf = %{["#{self.join('", "')}"]}
  buf << "^#@boost" if @boost != 1.0
  return buf
end