📄 field.pm
字号:
package Plucene::Document::Field;=head1 NAME Plucene::Document::Field - A field in a Plucene::Document=head1 SYNOPSIS 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);=head1 DESCRIPTIONEach Plucene::Document is made up of Plucene::Document::Fieldobjects. Each of these fields can be stored, indexed or tokenised.=head1 FIELDS=cutuse strict;use warnings;use base qw(Class::Accessor::Fast);__PACKAGE__->mk_accessors( qw(name string is_stored is_indexed is_tokenized reader));=head2 nameReturns the name of the field.=head2 stringReturns the value of the field.=head2 is_storedReturns true if the field is or will be stored, or false if it wascreated with C<UnStored>.=head2 is_indexedReturns true if the field is or will be indexed, or false if it wascreated with C<UnIndexed>.=head2 is_tokenizedReturns true if the field is or will be tokenized, or false if it wascreated with C<UnIndexed> or C<Keyword>.=cutuse Carp qw(confess);=head1 METHODS=head2 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. =cutsub Keyword { my ($self, $name, $string) = @_; return $self->new({ name => $name, string => $string, is_stored => 1, is_indexed => 1, is_tokenized => 0 });}=head2 UnIndexed 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. =cutsub UnIndexed { my ($self, $name, $string) = @_; return $self->new({ name => $name, string => $string, is_stored => 1, is_indexed => 0, is_tokenized => 0 });}=head2 Text my $field = Plucene::Document::Field->Text($name, $string);This will make a new Plucene::Document::Field object that is stored,indexed and tokenised. =cutsub Text { my ($self, $name, $string) = @_; return $self->new({ name => $name, string => $string, is_stored => 1, is_indexed => 1, is_tokenized => 1 });}=head2 UnStored 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.=cutsub UnStored { my ($self, $name, $string) = @_; return $self->new({ name => $name, string => $string, is_stored => 0, is_indexed => 1, is_tokenized => 1 });}1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -