KinoSe...earcher(3pm)

πŸ’– KinoSearch1::Searcher β€” the 3pm manual page, but make it cute πŸ’–

okay bestie, gather round, because this is the page for KinoSearch1::Searcher β€” that's a Perl module doc, section 3pm, from the User Contributed Perl Documentation. she's the one who actually runs your searches. no cap. πŸ’…


✨ NAME ✨

KinoSearch1::Searcher β€” execute searches πŸ¦‹

like. she searches. that's the whole job. that's the vibe.


✨ SYNOPSIS ✨

my $analyzer = KinoSearch1::Analysis::PolyAnalyzer->new(
    language => 'en',
);

my $searcher = KinoSearch1::Searcher->new(
    invindex => $invindex,
    analyzer => $analyzer,
);
my $hits = $searcher->search( query => 'foo bar' );

this is it. this is the whole glow-up. build an analyzer, build a searcher, hit search(), get $hits. main character energy from start to finish. ✨


✨ DESCRIPTION ✨

use the Searcher class to perform queries against an invindex. that's the assignment and she ate. πŸ”₯


✨ METHODS ✨

🌸 new

my $searcher = KinoSearch1::Searcher->new(
    invindex => $invindex,
    analyzer => $analyzer,
);

Constructor, babes. she takes two labeled parameters and highkey both of them are required β€” no skipping, no shortcuts, no "i'll add it later". πŸ™ˆ

  • invindex β€” can be either a path to an invindex, or a KinoSearch1::Store::InvIndex object. your choice, both slay. πŸ’–
  • analyzer β€” an object which subclasses KinoSearch1::Analysis::Analyer, such as a PolyAnalyzer. πŸŽ€ and listen: this has to be identical to the Analyzer you used at index-time, or the results won't match up. literally identical. not "basically the same". identical. iykyk. 😭
my $hits = $searcher->search(
    query  => $query,  # required
    filter => $filter, # default: undef (no filtering)
);

process a search and return a Hits object. search() expects labeled hash-style parameters β€” she's a labels girl, she needs to know what's what. πŸ’…

  • query β€” can be either an object which subclasses KinoSearch1::Search::Query, or a query string. if it's a query string, it will be parsed using a QueryParser and a search will be performed against all indexed fields in the invindex. for more sophisticated searching, supply Query objects, such as TermQuery and BooleanQuery. ✨
  • filter β€” must be a KinoSearch1::Search::QueryFilter. search results will be limited to only those documents which pass through the filter. she's picky and honestly? valid. 🫢

✨ Caching a Searcher ✨

when a Searcher is created, a small portion of the invindex is loaded into memory. 🧠✨ for large document collections, this startup time may become noticeable β€” in which case reusing the searcher is likely to speed up your search application. caching a Searcher is especially helpful when running a high-activity app under mod_perl. πŸ”₯

Searcher objects always represent a snapshot of an invindex as it existed when the Searcher was created. πŸ“Έ so if you want the search results to reflect modifications to an invindex, you must create a new Searcher after the update process completes. no, she will not magically know about your edits. she is not psychic. create a new one. periodt. πŸ’…


Copyright 2005-2010 Marvin Humphrey πŸ’œ


✨ LICENSE, DISCLAIMER, BUGS, etc. ✨

See KinoSearch1 version 1.01. πŸ‘‘


and that's the whole page, bestie!! this one shipped as perl v5.42.3, dated 2026-08-20, straight from the KinoSearch1 crew at version 1.01 β€” go forth and search, you absolute icon. πŸ¦‹πŸŒˆβ­πŸ’–

πŸ“¦ where this page comes from