Plucen...dInfos(3pm)
β¨ Plucene::Index::FieldInfos β a collection of FieldInfo objects β¨
okay bestie, welcome to the Plucene::Index::FieldInfos page π this is part of the User Contributed Perl Documentation, and honestly? it's giving "tiny module, huge main character energy." let's get into it π«Ά
πΈ SYNOPSIS πΈ
my $fis = Plucene::Index::FieldInfos->new($dir_name);
my $fis = Plucene::Index::FieldInfos->new($dir_name, $file);
$fis->add(Plucene::Document $doc, $indexed);
$fis->add(Plucene::Index::FieldInfos $other_fis, $indexed);
$fis->add($name, $indexed);
$fis->write($path);
my @fields = $fis->fields;
my $field_number = $fis->field_number($name);
my $field_info = $fis->field_info($name);
my $field_name = $fis->field_name($number);
my $num_fields = $fis->size;
likeβ¦ look at all those lil method calls, they're so cute, they're so functional π
π¦ DESCRIPTION π¦
so basically: this is a collection of field info objects, and the way that these field info objects just ~live~ inside the field infos file? iconic. no cap. that's literally the whole vibe π
π METHODS π
π new
my $fis = Plucene::Index::FieldInfos->new($dir_name);
my $fis = Plucene::Index::FieldInfos->new($dir_name, $file);
this will create a brand new Plucene::Index::FieldInfos object for you β¨ you pass in the directory, and then optionally a filename. the filename is optional, bestie, don't stress about it π
π add
$fis->add(Plucene::Document $doc, $indexed);
$fis->add(Plucene::Index::FieldInfos $other_fis, $indexed);
$fis->add($name, $indexed);
this will add the fields from a Plucene::Document or from a Plucene::Index::FieldsInfos over to the field infos file π₯
it is also possible to pass the name of a field and have it added to the file β yes, you can just hand it a $name and it goes in. versatile queen π
π field_number
my $field_number = $fis->field_number($name);
this will return the field number of the field with $name π’
β οΈ if there is no match, then-1is returned. not an error, not a die, just a lil-1. so check for it, bestie π
β fields
my @fields = $fis->fields;
this will return all the fields. every single one. the whole squad πΈ
π§ field_info
my $field_info = $fis->field_info($name);
this will return the field info for the field called $name π
π field_name
my $field_name = $fis->field_name($number);
this will return the field name for the field whose number is $number π (yes it's the reverse of field_number, they're a matched set, we love a duo)
π«Ά size
my $num_fields = $fis->size;
this returns the number of field info objects π not a personality size, a field-info-object size. important distinction.
π₯ write
$fis->write($path);
this will write the field info objects to $path βοΈ that's it, that's the method, she's simple, she's effective, she ate π₯
that's the whole page, bestie!! go forth and index your fields π
this lil doc is perl v5.36.0, dated 2022-12-04 π¦ mwah, bye π β¨
π¦ 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