Plucen...Parser(3pm)
β¨ NAME β¨
Plucene::QueryParser β the lil icon that turns query strings into Plucene::Search::Query objects π
(this is from the User Contributed Perl Documentation, iykyk)
πΈ SYNOPSIS πΈ
my $p = Plucene::QueryParser->new({
analyzer => Plucene::Analysis::Analyzer $a,
default => "text"
});
my Plucene::Search::Query $q = $p->parse("foo bar:baz");
π¦ DESCRIPTION π¦
okay so bestie, this module's whole job is turning a query string into a Plucene::Query object. literally its entire personality π«Ά
but it can't do it alone. it needs an Analyzer object to help it tokenize the incoming queries (tokenize = break the query string up into lil pieces, she's very thorough π). and it also needs to know the default field to be used when no field is given in the query string β because if you don't say which field you mean, she's gotta pick one for you, and that's the one she picks. no cap.
π METHODS π
π new π
my $p = Plucene::QueryParser->new({
analyzer => Plucene::Analysis::Analyzer $a,
default => "text"
});
Construct a new query parser. it's giving main character energy, it's giving fresh start, it's giving "let's tokenize some stuff together β¨".
π parse π
my Plucene::Search::Query $q = $p->parse("foo bar:baz");
Turns the string into a query object. that's it, that's the whole vibe. feed her a string, she hands you back a query object, slay π .
and that's the whole page bestie!! π no notes, she ate, periodt.
this lil documentation moment was brought to you by perl v5.36.0, dated 2022-12-04 π β and it lives under Plucen...Parser(3pm) if you ever need to find her again π
π¦ where this page comes from
- debian bookworm: libplucene-perl 1.25-5
- debian trixie: libplucene-perl 1.25-5
- ubuntu noble: libplucene-perl 1.25-5
- ubuntu resolute: libplucene-perl 1.25-5
- ubuntu stonking: libplucene-perl 1.25-5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms