Plucen...eQuery(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::PhraseQuery β€” a query that matchs a phrase ✨

(okay yes, "matchs" is literally how it's spelled up top, I'm not touching it, she's iconic, she stays πŸ’…)

This page lives in the User Contributed Perl Documentation, section 3pm, and the manpage header calls her Plucen...eQuery(3pm) because terminals are dramatic and truncate things. Bestie, it's just Plucene::Search::PhraseQuery. πŸ¦‹


🌸 SYNOPSIS 🌸

# isa Plucene::Search::Query

That's it, that's the whole synopsis. She's a subclass, she inherits, she's giving legacy. πŸ‘‘


πŸ’– DESCRIPTION πŸ’–

A Query that matches documents containing a particular sequence of terms. Periodt.

A phrase query is all about a query being matched against a consecutive sequence of terms in the field. So like, the phrase query 'winding road' should match 'winding road'… but not 'road winding'. Word order matters, bestie, this is not a free-for-all 😭 (the one exception being more relaxed slop factors, which we'll get to, don't worry).

Phrase queries show up in Plucene's API as instances of the PharseQuery class β€” and yep, that spelling is straight from the source, I am simply the messenger πŸ™ˆ. These instances hold an ordered list of Term objects representing the terms to match. And for obvious reasons, all terms in a PhraseQuery must refer to the same field. No field-hopping, she's monogamous. πŸ’–

A phrase query may also have an optional boost factor and an optional slop parameter (default = 0). The slop parameter lets you relax the phrase matching, by accepting somewhat out-of-order sequences of the terms. So if your vibes are slightly chaotic, slop is your girl. 🌈


✨ METHODS ✨

🫢 add

Adds a term to the end of the query phrase. Like adding a new word to the end of the sentence, except the sentence is a query and the word is a term. Slay. πŸ’…

🧚 sum_squared_weights

The sum squared weights of this query. Math, but make it fashion. ✨

⭐ normalize

Normalize the query. Getting her into her most standard, well-adjusted form. πŸŽ€

πŸ”₯ to_string

Prints a user-readable version of this query. So you can actually look at her instead of squinting at an object dump. πŸ‘‘


Heads up bestie: that PharseQuery spelling in the DESCRIPTION is exactly how it appears in this manual page. I'm reporting, not fixing. 🫑

and that's the whole page!! πŸ’œ This was perl v5.36.0, dated 2022-12-04, and the footer signs off as Plucen...eQuery(3pm) from the User Contributed Perl Documentation. Bye bestie, go match some phrases, not the other way around πŸŒΈπŸ’–πŸ¦‹

πŸ“¦ where this page comes from