Plucen...:Field(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

πŸ’– Plucene::Document::Field β€” a field in a Plucene::Document πŸ’–

okay so bestie, listen. this is Plucene::Document::Field, from the User Contributed Perl Documentation corner of the perl universe. it's giving tiny-but-mighty. it's giving building block. let's get into it 🫢


✨ SYNOPSIS ✨

my $field = Plucene::Document::Field->Keyword($name, $string);
my $field = Plucene::Document::Field->Text($name, $string);

my $field = Plucene::Document::Field->UnIndexded($name, $string);
my $field = Plucene::Document::Field->UnStored($name, $string);

(yes, UnIndexded β€” that's literally how it's spelled up there, we don't fix, we report πŸ’…)


🌸 DESCRIPTION 🌸

So. Every single Plucene::Document is made up of Plucene::Document::Field objects. Like, the document is the outfit and the fields are the accessories, no cap. πŸŽ€

And each one of these fields can be:

  • stored πŸ’Ύ
  • indexed πŸ”
  • tokenised βœ‚οΈ

...or not! any combo. that's the whole vibe. the methods below decide which combo you get. main character energy fr fr.


πŸ¦‹ FIELDS πŸ¦‹

these are the lil accessors, the little peek-behind-the-curtain moments πŸ‘‘

name

Returns the name of the field. literally just the name. iconic.

string

Returns the value of the field. the actual content, the substance, the ~lore~.

is_stored

Returns true if the field is or will be stored, or false if it was created with UnStored. 🫢

is_indexed

Returns true if the field is or will be indexed, or false if it was created with UnIndexed.

is_tokenized

Returns true if the field is or will be tokenized, or false if it was created with UnIndexed or Keyword. βœ‚οΈ


πŸ’… METHODS πŸ’…

four ways to make a field. pick your fighter.

Keyword

my $field = Plucene::Document::Field->Keyword($name, $string);

This will make a new Plucene::Document::Field object that is stored and indexed, but not tokenised. it's the "take me as i am, whole, don't break me into pieces" field. πŸŽ€

UnIndexed

my $field = Plucene::Document::Field->UnIndexded($name, $string);

This will make a new Plucene::Document::Field object that is stored, but not indexed and not tokenised. it's just... sitting there. being pretty. keeping your data safe. 🌸

⚠️ heads up: the method is named UnIndexed but the synopsis line literally writes UnIndexded. that's a typo in the docs themselves, and we are faithfully preserving it because facts are facts. iykyk.

Text

my $field = Plucene::Document::Field->Text($name, $string);

This will make a new Plucene::Document::Field object that is stored, indexed and tokenised. the full package. ate and left no crumbs. πŸ”₯

UnStored

my $field = Plucene::Document::Field->UnStored($name, $string);

This will make a new Plucene::Document::Field object that isn't stored, but is indexed and tokenised. it's there for the search, not for the archive. mysterious. elusive. πŸ¦‹


πŸ‘‘ quick vibe recap

  • Keyword β†’ stored βœ… indexed βœ… tokenised ❌
  • UnIndexed β†’ stored βœ… indexed ❌ tokenised ❌
  • Text β†’ stored βœ… indexed βœ… tokenised βœ…
  • UnStored β†’ stored ❌ indexed βœ… tokenised βœ…

no cap, that's the whole entire thing. 🌈


πŸ’œ that's a wrap on Plucene::Document::Field(3pm), bestie! this page ships as part of perl v5.36.0, dated 2022-12-04, in the User Contributed Perl Documentation collection. go forth and index responsibly. mwah πŸŽ€βœ¨
πŸ“¦ where this page comes from