Plucene::Index::FieldsReader - read Fields in a Document
my $reader = Plucene::Index::FieldsReader->new(
$dir_name, $segment, $field_infos);
my Plucene::Document $doc = $reader->doc($offset);
my $size = $reader->size;
This class gives access to documents within the index.
my $reader = Plucene::Index::FieldsReader->new(
$dir_name, $segment, $field_infos);
This will create a new Plucene::Index::FieldsReader with the passed in
directory name, segment and field infos.
=cut
sub new {
my ($class, $dir, $seg, $fn) = @_;
bless {
field_infos => $fn,
fields => Plucene::Store::InputStream->new(``$dir/$seg.fdt''),
index => Plucene::Store::InputStream->new(``$dir/$seg.fdx''),
size => ((-s ``$dir/$seg.fdx'') / 8) }, $class;
}
my $size = $reader->size;
This returns the size.
my Plucene::Document $doc = $reader->doc($offset);
This will return the Plucene::Document object found at the passed in
position.
|