27 Feb 2018 08:40:23 UTC
- Distribution: Lucy
- Module version: 0.006002
- Source (raw)
- Pod Source (raw)
- Browse (raw)
- How to Contribute
- Clone repository
- Testers (1193 / 3 / 7)
- KwaliteeBus factor: 2
- License: apache_2_0
- Perl: v5.8.3
- Activity24 month
- Download (1.12MB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:6 non-PAUSE usersNWELLNHOF Nick Wellnhoferand 1 contributors
- The Apache Lucy Project <dev at lucy dot apache dot org>
Lucy::Index::SegWriter - Write one segment of an index.
SegWriter is a conduit through which information fed to Indexer passes. It manages Segment and Inverter, invokes the Analyzer chain, and feeds low level DataWriters such as PostingListWriter and DocWriter.
The sub-components of a SegWriter are determined by Architecture. DataWriter components which are added to the stack of writers via add_writer() have Add_Inverted_Doc() invoked for each document supplied to SegWriter’s add_doc().
$seg_writer->register( api => $api, # required component => $component, # required );
api - The name of the DataWriter api which
component - A DataWriter.
my $obj = $seg_writer->fetch($api);
Retrieve a registered component.
api - The name of the DataWriter api which the component implements.
Add a DataWriter to the SegWriter’s stack of writers.
$seg_writer->add_doc( doc => $doc, # required boost => $boost, # default: 1.0 );
Add a document to the segment. Inverts
doc, increments the Segment’s internal document id, then calls Add_Inverted_Doc(), feeding all sub-writers.
$seg_writer->add_segment( reader => $reader, # required doc_map => $doc_map, # default: undef );
Add content from an existing segment into the one currently being written.
reader - The SegReader containing content to add.
doc_map - An array of integers mapping old document ids to new. Deleted documents are mapped to 0, indicating that they should be skipped.
Complete the segment: close all streams, store metadata, etc.
Lucy::Index::SegWriter isa Lucy::Index::DataWriter isa Clownfish::Obj.