Plucene::Index::FieldsWriter - writes Fields to a Document
my $writer = Plucene::Index::FieldsWriter->new(
$dir_name, $segment, $field_infos);
$writer->add_document(Plucene::Document $doc);
This class add documents to the appropriate files.
my $writer = Plucene::Index::FieldsWriter->new(
$dir_name, $segment, $field_infos);
This will create a new Plucene::Index::FieldsWriter object with the passed
directory name, segment and field infos.
=cut
# private FieldInfos fieldInfos;
# private OutputStream fieldsStream;
# private OutputStream indexStream;
# FieldsWriter(Directory d, String segment, FieldInfos fn)
# throws IOException {
# fieldInfos = fn;
# fieldsStream = d.createFile(segment + ``.fdt'');
# indexStream = d.createFile(segment + ``.fdx'');
# }
sub new {
my ($self, $d, $segment, $fn) = @_;
bless {
field_infos => $fn,
segment => $segment,
fields_stream => Plucene::Store::OutputStream->new(``$d/$segment.fdt''),
index_stream => Plucene::Store::OutputStream->new(``$d/$segment.fdx''),
}, $self;
}
$writer->close;
$writer->add_document(Plucene::Document $doc);
This will add the passed Plucene::Document.
|