| Plucene documentation | Contained in the Plucene distribution. |
Plucene::Document::Field - A field in a Plucene::Document
my $field = Plucene::Document::Field->Keyword($name, $string); my $field = Plucene::Document::Field->Text($name, $string); my $field = Plucene::Document::Field->UnIndexded($name, $string); my $field = Plucene::Document::Field->UnStored($name, $string);
Each Plucene::Document is made up of Plucene::Document::Field objects. Each of these fields can be stored, indexed or tokenised.
Returns the name of the field.
Returns the value of the field.
Returns true if the field is or will be stored, or false if it was
created with UnStored.
Returns true if the field is or will be indexed, or false if it was
created with UnIndexed.
Returns true if the field is or will be tokenized, or false if it was
created with UnIndexed or Keyword.
my $field = Plucene::Document::Field->Keyword($name, $string);
This will make a new Plucene::Document::Field object that is stored and indexed, but not tokenised.
my $field = Plucene::Document::Field->UnIndexded($name, $string);
This will make a new Plucene::Document::Field object that is stored, but not indexed or tokenised.
my $field = Plucene::Document::Field->Text($name, $string);
This will make a new Plucene::Document::Field object that is stored, indexed and tokenised.
my $field = Plucene::Document::Field->UnStored($name, $string);
This will make a new Plucene::Document::Field object that isn't stored, but is indexed and tokenised.
| Plucene documentation | Contained in the Plucene distribution. |
package Plucene::Document::Field;
use strict; use warnings; use base qw(Class::Accessor::Fast); __PACKAGE__->mk_accessors( qw(name string is_stored is_indexed is_tokenized reader));
use Carp qw(confess);
sub Keyword { my ($self, $name, $string) = @_; return $self->new({ name => $name, string => $string, is_stored => 1, is_indexed => 1, is_tokenized => 0 }); }
sub UnIndexed { my ($self, $name, $string) = @_; return $self->new({ name => $name, string => $string, is_stored => 1, is_indexed => 0, is_tokenized => 0 }); }
sub Text { my ($self, $name, $string) = @_; return $self->new({ name => $name, string => $string, is_stored => 1, is_indexed => 1, is_tokenized => 1 }); }
sub UnStored { my ($self, $name, $string) = @_; return $self->new({ name => $name, string => $string, is_stored => 0, is_indexed => 1, is_tokenized => 1 }); } 1;