Method: Ferret::Document::Field.new_binary_field

Defined in:
lib/ferret/document/field.rb

.new_binary_field(name, value, stored) ⇒ Object

Create a stored field with binary value. Optionally the value may be compressed. But it obviously won’t be tokenized or term vectored or anything like that.

name

The name of the field

value

The binary value

store

How value should be stored (compressed or not.)



268
269
270
271
272
273
# File 'lib/ferret/document/field.rb', line 268

def Field.new_binary_field(name, value, stored)
  if (stored == Store::NO)
    raise ArgumentError, "binary values can't be unstored"
  end
  Field.new(name, value, stored, Index::NO, TermVector::NO, true)
end