Lucy::...Manager(3pm)
π Lucy::Index::IndexManager β the manual, but make it make sense π
okay bestie, so this is Lucy::Index::IndexManager, and it lives in the User Contributed Perl Documentation section (3pm, for the Perl girlies π«Ά). It's the boss of index updating, locking, and file deletion. Let's get into it. β¨
πΈ NAME πΈ
Lucy::Index::IndexManager β the policies governing index updating, locking, and file deletion. she's the rule-maker, the vibe-setter, the one in charge. π
β¨ SYNOPSIS β¨
use Sys::Hostname qw( hostname );
my $hostname = hostname() or die "Can't get unique hostname";
my $manager = Lucy::Index::IndexManager->new(
host => $hostname,
);
# Index time:
my $indexer = Lucy::Index::Indexer->new(
index => '/path/to/index',
manager => $manager,
);
# Search time:
my $reader = Lucy::Index::IndexReader->open(
index => '/path/to/index',
manager => $manager,
);
my $searcher = Lucy::Search::IndexSearcher->new( index => $reader );
like, she rolls up to both index time and search time. versatile queen. π
π DESCRIPTION π
IndexManager is an advanced-use class, meaning it's for when you're ready to level up β she controls index locking, updating, merging, and deletion behaviors. no cap.
so here's the tea β: IndexManager and Architecture are complementary classes, they're besties who each handle a different lane:
Architectureβ defines traits and behaviors which cannot change for the life of an index. she's locked in forever, periodt.IndexManagerβ defines rules which may change from process to process. she's flexible, she's fluid, she's giving main character energy. π¦
π CONSTRUCTORS π
new
my $manager = Lucy::Index::IndexManager->new(
host => $hostname, # default: ""
);
Create a fresh new IndexManager. baby's first manager. π
hostβ an identifier which should be unique per-machine. lowkey important, don't skip it.lock_factoryβ aLockFactory. π
π METHODS π
set_folder
$index_manager->set_folder($folder);
$index_manager->set_folder(); # default: undef
Setter for the "folder" member. Typical clients (Indexer, IndexReader) will use this method to install their own Folder instance. so they're the ones doing the installing, not you. noted. π
get_folder
my $folder = $index_manager->get_folder();
Getter for the "folder" member. the matching pair, as she should. π
get_host
my $string = $index_manager->get_host();
Getter for the "host" member. she tells you where she's from. π
recycle
my $arrayref = $index_manager->recycle(
reader => $reader, # required
del_writer => $del_writer, # required
cutoff => $cutoff, # required
optimize => $optimize, # default: false
);
Returns an array of SegReaders representing segments that should be consolidated. π§Ή
Implementations must balance index-time churn against search-time degradation due to segment proliferation β so like, don't let segments multiply like bunnies π° or your searches will suffer. The default implementation prefers small segments, or segments with a high proportion of deletions. she's got taste.
readerβ aPolyReader.del_writerβ aDeletionsWriter.cutoffβ a segment number which all returnedSegReadersmust exceed. (so, strictly bigger thancutoff, bestie)optimizeβ a boolean indicating whether to spend extra time optimizing the index for search-time performance. trading time for speed, iconic behavior honestly β³β‘οΈβ‘
make_write_lock
my $lock = $index_manager->make_write_lock();
Create the Lock which controls access to modifying the logical content of the index. π one at a time, girlies, we're not fighting over the index.
set_write_lock_timeout
$index_manager->set_write_lock_timeout($timeout);
Setter for write lock timeout. Default: 1000 milliseconds. β°
get_write_lock_timeout
my $int = $index_manager->get_write_lock_timeout();
Getter for write lock timeout. she'll tell you how long she's willing to wait. π
set_write_lock_interval
$index_manager->set_write_lock_interval($timeout);
Setter for write lock retry interval. Default: 100 milliseconds. π that's how often she comes back to try again. persistent queen.
get_write_lock_interval
my $int = $index_manager->get_write_lock_interval();
Getter for write lock retry interval. π«
π INHERITANCE π
Lucy::Index::IndexManager isa Clownfish::Obj. she comes from a long line of distinguished objects, and she honors her lineage. π§¬
quick reminder bestie: this is the whole manual, every flag and default included β nothing skipped, nothing invented. read it, love it, use it responsibly. π
that's the whole page, fr fr πΈ this doc came from the User Contributed Perl Documentation, built for perl v5.42.0 and dated 2025-07-25 β so if you're reading this from the future, hi, hope the index is thriving π¦β¨ mwah, go slay your segments π
π¦ where this page comes from
- fedora 43: perl-Lucy 0.6.2-26.fc43 Β· Apache-2.0 AND MIT AND Unicode-DFS-2015
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms