Plucen...Reader(3pm)
π Plucene::Index::SegmentsReader β the manual, but make it cute β¨
okay so bestie, you've found yourself at the Plucene::Index::SegmentsReader page from the User Contributed Perl Documentation β the 3pm one, you know the vibe π
. Pull up a chair, grab a strawberry π, and let's get into it.
πΈ NAME πΈ
Plucene::Index::SegmentsReader β reads the segments. that's it, that's the whole job, and she does it flawlessly no cap π
β¨ SYNOPSIS β¨
here's the whole vibe, laid out for you exactly as written:
my $segs_reader = Plucene::Index::SegmentsReader
->new($dir, Plucene::Index::SegmentReader @readers);
my $num_docs = $segs_reader->num_docs;
my $doc = $segs_reader->document($id);
my $norms = $seg_reader->norms($field);
my $doc_freq = $segs_reader->doc_freq($term);
my Plucene::Index::SegmentsTermEnum $term_enum
= $segs_reader->terms($term);
my Plucene::Index::SegmentsTermDocs $term_docs
= $segs_reader->term_docs;
my Plucene::Index::SegmentsTermPositions $term_positions
= $segs_reader->term_positions;
if ($segs_reader->is_deleted($id)) { ... }
like... look at her go. every method, right there, ready to serve π«Ά
π¦ DESCRIPTION π¦
This is the segments reader class. she reads segments. iconic behavior, honestly, main character energy fr fr π
π METHODS π
new β¨
my $segs_reader = Plucene::Index::SegmentsReader
->new($dir, Plucene::Index::SegmentReader @readers);
This will create a new Plucene::Index::SegmentsReader object with the passed directory and Plucene::Index::SegmentReader objects. give her a $dir and a whole list of Plucene::Index::SegmentReader besties and she's born π
num_docs π’
my $num_docs = $segs_reader->num_docs;
This will return the number of documents in all the segments in the Reader. all of them, across every segment, counted up. she's thorough like that π
document π
my $doc = $segs_reader->document($id);
This will return the document at the passed document id. hand her an $id, she hands you back the doc. transactional queen π
is_deleted π
if ($segs_reader->is_deleted($id)) { ... }
the vibe check for whether a doc got deleted. no prose attached in the original, just the snippet β so here's the snippet, doing its thing.
norms π
my $norms = $seg_reader->norms($field);
This returns the norms for the passed field. give her a $field, get your norms back. slay.
terms π
my Plucene::Index::SegmentsTermEnum $term_enum
= $segs_reader->terms($term);
This will return the Plucene::Index::SegmentsTermEnum object for the passed in term. yes bestie, a whole enum object, just for your $term π§
doc_freq π
my $doc_freq = $segs_reader->doc_freq($term);
This returns the number of documents containing the passed term. how popular is your $term? she'll tell you. lowkey nosy but we love her for it π
term_docs π
my Plucene::Index::SegmentsTermDocs $term_docs
= $segs_reader->term_docs;
This will return the Plucene::Index::SegmentsTermDocs object. no args needed, she just hands it over π
term_positions π
my Plucene::Index::SegmentsTermPositions $term_positions
= $segs_reader->term_positions;
This will return the Plucene::Index::SegmentsTermPositions object. again β no args, she just gives it to you, generous as always π
and that's the whole page bestie, nothing skipped, nothing skipped, every flag-less method accounted for π«Ά
mwah π that was written for perl v5.36.0, dated 2022-12-04 β so yeah, she's a lil vintage but she still ate, and she's still absolutely serving. periodt.
π¦ where this page comes from
- debian bookworm: libplucene-perl 1.25-5
- debian trixie: libplucene-perl 1.25-5
- ubuntu noble: libplucene-perl 1.25-5
- ubuntu resolute: libplucene-perl 1.25-5
- ubuntu stonking: libplucene-perl 1.25-5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms