Plucen...mQuery(3pm)

πŸ“¦
version 1.25 Β· 2 versions
  • 1.25 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.25 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

🌸 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