Lucy::...dMerger(3pm)
π Lucy::Index::BackgroundMerger π
okay so bestie, welcome to the Lucy::...dMerger(3pm) page β that's the User Contributed Perl Documentation corner of your terminal, and today we're talking about the Lucy index class that does its thing while you're not looking. slay. π¦
β¨ NAME β¨
Lucy::Index::BackgroundMerger β consolidate index segments in the background. it's giving "I'll handle it, you go live your life." π
β¨ SYNOPSIS β¨
my $bg_merger = Lucy::Index::BackgroundMerger->new(
index => '/path/to/index',
);
$bg_merger->commit;
β¨ DESCRIPTION β¨
Adding documents to an index is usually fast, but every once in a while the index must be compacted and an update takes substantially longer to complete. π that's just the vibe sometimes. See FastUpdates for how to use this class to control worst-case index update performance.
As with Indexer, see FileLocking if your index is on a shared volume. fr fr, shared volumes are a whole situation. π«Ά
β¨ CONSTRUCTORS β¨
new
my $bg_merger = Lucy::Index::BackgroundMerger->new(
index => '/path/to/index', # required
manager => $manager # default: created internally
);
Open a new BackgroundMerger. β¨ fresh out the box.
indexβ Either a string filepath or aFolder. your call, bestie.managerβ AnIndexManager. If not supplied, anIndexManagerwith a 10-second write lock timeout will be created. no cap, it just makes one for you. π
β¨ METHODS β¨
optimize
$background_merger->optimize();
Optimize the index for search-time performance. This may take a while, as it can involve rewriting large amounts of data. β³ yeah it's a whole thing, go grab a snack.
commit
$background_merger->commit();
Commit any changes made to the index. Until this is called, none of the changes made during an indexing session are permanent. π so likeβ¦ do not skip this one.
Calls prepare_commit() implicitly if it has not already been called. she's proactive like that. π
prepare_commit
$background_merger->prepare_commit();
Perform the expensive setup for commit() in advance, so that commit() completes quickly. main character energy: do the hard part early so the finale is smooth. β
Towards the end of prepare_commit(), the BackgroundMerger attempts to re-acquire the write lock, which is then held until commit() finishes and releases it. π so like, hold onto your lock, queen.
β¨ INHERITANCE β¨
Lucy::Index::BackgroundMerger isa Clownfish::Obj. family tree stays iconic. π
and that's the page, bestie!! π this beauty is running on perl v5.42.0, dated 2025-07-25, and it lives under the manual name Lucy::...dMerger(3pm). go forth and merge in the background. periodt. π
β¨π
π¦ 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