Lucy::...ecture(3pm)

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

✨ NAME ✨

Lucy::Plan::Architecture β€” bestie, this is the glow-up control room where you configure the major components of an index πŸ’–

(it's a 3pm page, meaning it's Perl module docs, iykyk 🫢)


🌸 SYNOPSIS 🌸

okay so here's the vibe, copy this exactly:

package MyArchitecture;
use base qw( Lucy::Plan::Architecture );

use LucyX::Index::ZlibDocWriter;
use LucyX::Index::ZlibDocReader;

sub register_doc_writer {
    my ( $self, $seg_writer ) = @_;
    my $doc_writer = LucyX::Index::ZlibDocWriter->new(
        snapshot   => $seg_writer->get_snapshot,
        segment    => $seg_writer->get_segment,
        polyreader => $seg_writer->get_polyreader,
    );
    $seg_writer->register(
        api       => "Lucy::Index::DocReader",
        component => $doc_writer,
    );
    $seg_writer->add_writer($doc_writer);
}

sub register_doc_reader {
    my ( $self, $seg_reader ) = @_;
    my $doc_reader = LucyX::Index::ZlibDocReader->new(
        schema   => $seg_reader->get_schema,
        folder   => $seg_reader->get_folder,
        segments => $seg_reader->get_segments,
        seg_tick => $seg_reader->get_seg_tick,
        snapshot => $seg_reader->get_snapshot,
    );
    $seg_reader->register(
        api       => 'Lucy::Index::DocReader',
        component => $doc_reader,
    );
}

package MySchema;
use base qw( Lucy::Plan::Schema );

sub architecture {
    shift;
    return MyArchitecture->new(@_);
}

like… she's giving custom architecture realness πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so, by default, a Lucy index is made up of several main parts, and no we are NOT skipping any of them: lexicon, postings, stored documents, deletions, and highlight data. periodt ✨

The readers and writers for all that data get spawned by Architecture. Every single component does its thing at the segment level, and Architecture's factory methods are what you use to build up SegWriter and SegReader. no cap, that's the whole deal 🧚


πŸŽ€ CONSTRUCTORS πŸŽ€

new

my $arch = Lucy::Plan::Architecture->new;

Constructor! πŸŽ‰ Takes no arguments. She's low maintenance, we love that for her 🫢


πŸ’œ METHODS πŸ’œ

register_doc_writer

$architecture->register_doc_writer($writer);

Spawn a DataWriter and register() it with the SegWriter you hand over β€” which slides it onto the SegWriter's writer stack. stack 'em up bestie πŸ₯ž

  • writer β€” A SegWriter. (yes that's the whole description, she's simple like that)

register_doc_reader

$architecture->register_doc_reader($reader);

Spawn a DocReader and register it with the SegReader you supply. match made in heaven fr fr πŸ’ž

  • reader β€” A SegReader. (again, that's it, iconic minimalism)

πŸ‘‘ INHERITANCE πŸ‘‘

Lucy::Plan::Architecture isa Clownfish::Obj. the family tree ate, no notes πŸ’€


and that's the whole page bestie!! this came to you courtesy of perl v5.42.0, dated 2025-07-25, from the Lucy::...ecture(3pm) manual β€” go configure something gorgeous πŸ’…βœ¨

πŸ“¦ where this page comes from