Plucen...mQuery(3pm)
πΈ NAME πΈ
Plucene::Search::TermQuery β a query that contains a term π
(also known as Plucen...mQuery(3pm), that's the manual page name bestie, section 3pm, she's a Perl module doc π«Ά)
β¨ SYNOPSIS β¨
# isa Plucene::Search::Query
$term_query->normalize($norm);
my $ssw = $term_query->sum_squared_weights($searcher);
my $as_string = $term_query->as_string($field);
π¦ DESCRIPTION π¦
okay so. A query that matches a document containing a term. That's the whole vibe. π
Term queries are literally the simplest possible Plucene queries β like, no cap, the bare minimum β and they're used to match a single word. Term queries are represented by instances of the TermQuery class and contain the desired term (the word) plus a field name. And heads up: both of those are case sensitive. fr fr, don't play with the casing. π
The field you specify in a Term query must be a document field that was specified as 'indexible' during the indexing process. That's not optional, bestie, it's giving hard requirement. π
And here's the tea on matching: if the field was specified during indexing as 'tokenized', then the term will be matched against each of the tokens (words) found in that field. Otherwise β if it wasn't tokenized β it will be matched against the entire content of that field. Two totally different vibes, same query class. π
A term query may also have an optional boost factor (default = 1.0) that lets you increase or decrease the ranking of the documents it matches. So if you want your fave to show up first, that's your girl. β
π METHODS π
π term / idf / weight
Get / set these attributes. simple as that. π
π§ sum_squared_weights
my $ssw = $term_query->sum_squared_weights($searcher);
This will return the sum squared weights for the passed in searcher. that's it, that's the whole function, she's efficient π
πΈ normalize
$term_query->normalize($norm);
π to_string
my $as_string = $term_query->as_string($field);
perl v5.36.0 Β· 2022-12-04 β that's the version and date this page was born, and that's the whole manual page, bestie. go forth and query, you absolute icon πβ¨π
π¦ 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