Plucen...Reader(3pm)

πŸ“¦
version 1.25 Β· 2 versions
  • 1.25 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.25 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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