Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

plucene::index::fieldinfos(3pm) [debian man page]

Plucene::Index::FieldInfos(3pm) 			User Contributed Perl Documentation			   Plucene::Index::FieldInfos(3pm)

NAME
Plucene::Index::FieldInfos - a collection of FieldInfo objects SYNOPSIS
my $fis = Plucene::Index::FieldInfos->new($dir_name); my $fis = Plucene::Index::FieldInfos->new($dir_name, $file); $fis->add(Plucene::Document $doc, $indexed); $fis->add(Plucene::Index::FieldInfos $other_fis, $indexed); $fis->add($name, $indexed); $fis->write($path); my @fields = $fis->fields; my $field_number = $fis->field_number($name); my $field_info = $fis->field_info($name); my $field_name = $fis->field_name($number); my $num_fields = $fis->size; DESCRIPTION
This is a collection of field info objects, which happen to live in the field infos file. METHODS
new my $fis = Plucene::Index::FieldInfos->new($dir_name); my $fis = Plucene::Index::FieldInfos->new($dir_name, $file); This will create a new Plucene::Index::FieldInfos object with the passed directory and optional filename. add $fis->add(Plucene::Document $doc, $indexed); $fis->add(Plucene::Index::FieldInfos $other_fis, $indexed); $fis->add($name, $indexed); This will add the fields from a Plucene::Document or a Plucene::Index::FieldsInfos to the field infos file. It is also possible to pass the name of a field and have it added to the file. field_number my $field_number = $fis->field_number($name); This will return the field number of the field with $name. If there is no match, then -1 is returned. fields my @fields = $fis->fields; This will return all the fields. field_info my $field_info = $fis->field_info($name); This will return the field info for the field called $name. field_name my $field_name = $fis->field_name($number); This will return the field name for the field whose number is $number. size my $num_fields = $fis->size; This returns the number of field info objects. write $fis->write($path); This will write the field info objects to $path. perl v5.12.4 2011-08-14 Plucene::Index::FieldInfos(3pm)

Check Out this Related Man Page

Plucene::TestCase(3pm)					User Contributed Perl Documentation				    Plucene::TestCase(3pm)

NAME
Plucene::TestCase - Handy functions when testing Plucene SYNOPSIS
use Test::More tests => 10; use Plucene::TestCase; new_index { add_document( foo => "bar" ); }; re_index { add_document( foo => "baz" ); } with_reader { $READER->whatever; } my $hits = search("foo:ba*"); EXPORTS
$DIR A directory which is created for the purposes of this test, in which the index will be placed. It will normally be cleaned up at the end of the test, unless $Plucene::TestCase::DEBUG is set to allow you to peruse the entrails. $WRITER A variable holding the current "Index::Writer" object, if there is one. $READER A variable holding the current "Index::Reader" object, if there is one. $ANALYZER A variable holding the class name of the desired "Analysis::Analyzer" class. new_index BLOCK (Analyzer) Create a new index, and do the following stuff in the block before closing the index writer. $WRITER is set for the duration of the block. The optional parameter should be the class name of the analyzer to use; if not specified, the value from $ANALYZER, which in turn defaults to "Plucene::Analysis::SimpleAnalyzer", will be used. re_index BLOCK (Analyzer) Same as "new_index", but doesn't create a new index, rather re-uses an old one. add_document( field1 => value1, ...) Add a new document to the index, with the given fields and values with_reader BLOCK Opens an index reader in $READER and runs the block. search Searches for the query given. If any fields are not specified, they will be assumed to be the default "text". Returns a "Plucene::Search::Hits" object. The value of $ANALYZER will be used to construct an analyzer for the query string. perl v5.12.4 2011-08-14 Plucene::TestCase(3pm)
Man Page