1Lucy::Index::SegReader(U3s)er Contributed Perl DocumentatLiuocny::Index::SegReader(3)
2
3
4

NAME

6       Lucy::Index::SegReader - Single-segment IndexReader.
7

SYNOPSIS

9           my $polyreader = Lucy::Index::IndexReader->open(
10               index => '/path/to/index',
11           );
12           my $seg_readers = $polyreader->seg_readers;
13           for my $seg_reader (@$seg_readers) {
14               my $seg_name = $seg_reader->get_seg_name;
15               my $num_docs = $seg_reader->doc_max;
16               print "Segment $seg_name ($num_docs documents):\n";
17               my $doc_reader = $seg_reader->obtain("Lucy::Index::DocReader");
18               for my $doc_id ( 1 .. $num_docs ) {
19                   my $doc = $doc_reader->fetch_doc($doc_id);
20                   print "  $doc_id: $doc->{title}\n";
21               }
22           }
23

DESCRIPTION

25       SegReader interprets the data within a single segment of an index.
26
27       Generally speaking, only advanced users writing subclasses which
28       manipulate data at the segment level need to deal with the SegReader
29       API directly.
30
31       Nearly all of SegReaderXs functionality is implemented by pluggable
32       components spawned by ArchitectureXs factory methods.
33

METHODS

35   get_seg_name
36           my $string = $seg_reader->get_seg_name();
37
38       Return the name of the segment.
39
40   get_seg_num
41           my $int = $seg_reader->get_seg_num();
42
43       Return the number of the segment.
44
45   del_count
46           my $int = $seg_reader->del_count();
47
48       Return the number of documents which have been marked as deleted but
49       not yet purged from the index.
50
51   doc_max
52           my $int = $seg_reader->doc_max();
53
54       Return the maximum number of documents available to the reader, which
55       is also the highest possible internal document id.  Documents which
56       have been marked as deleted but not yet purged from the index are
57       included in this count.
58
59   doc_count
60           my $int = $seg_reader->doc_count();
61
62       Return the number of documents available to the reader, subtracting any
63       that are marked as deleted.
64
65   _offsets
66           my $i32_array = $seg_reader->_offsets();
67
68       Return an array with one entry for each segment, corresponding to
69       segment doc_id start offset.
70
71   seg_readers
72           my $arrayref = $seg_reader->seg_readers();
73
74       Return an array of all the SegReaders represented within the
75       IndexReader.
76

INHERITANCE

78       Lucy::Index::SegReader isa Lucy::Index::IndexReader isa
79       Lucy::Index::DataReader isa Clownfish::Obj.
80
81
82
83perl v5.32.1                      2021-01-27         Lucy::Index::SegReader(3)
Impressum