Lucy::...Reader(3pm)

πŸ“¦
version 0.6.2 Β· 2 versions
, in fedora 43

πŸ’– Lucy::...Reader(3pm) πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation for Lucy, and it's literally all about the Lucy::Index::DocReader situation. she's giving very much "interface energy" and we're gonna walk through her together, no cap. πŸŽ€


✨ NAME ✨

Lucy::Index::DocReader β€” the way you go get your stored documents back out. πŸ—‚οΈβœ¨


🌸 SYNOPSIS 🌸

my $doc_reader = $seg_reader->obtain("Lucy::Index::DocReader");
my $doc        = $doc_reader->fetch_doc($doc_id);

like, that's it. that's the whole vibe. two lines and you're fetching docs. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so DocReader defines the interface by which documents β€” and by "documents" we mean the full package, all the stored fields, every last one β€” get retrieved from the index. 🫢

the default implementation hands you back HitDoc objects. that's the tea. β˜•


πŸ‘‘ ABSTRACT METHODS πŸ‘‘

fetch_doc

my $hit_doc = $doc_reader->fetch_doc($doc_id);

okay so you call this and you grab the document that doc_id is pointing at. that's the whole job. ✨

Returns: a HitDoc. πŸŽ€


πŸ”₯ METHODS πŸ”₯

aggregator

my $result = $doc_reader->aggregator(
    readers => $readers,  # required
    offsets => $offsets,  # required
);

this one returns a DocReader that divvies up all the requests among its sub-readers based on the offset range. like a little delegation queen. πŸ‘‘

  • readers β€” an array of DocReaders. (required, bestie, don't forget her πŸ’–)
  • offsets β€” doc id start offsets for each reader. (also required!! πŸ™ˆ)

🌈 INHERITANCE 🌈

Lucy::Index::DocReader isa Lucy::Index::DataReader isa Clownfish::Obj. a whole little family tree, iconic honestly. 🧚


and that's the page!! this was documented with perl v5.42.0, dated 2025-07-25, and filed under Lucy::...Reader(3pm) β€” mwah, go forth and fetch docs bestie πŸ’œβœ¨

πŸ“¦ where this page comes from