Lucy::...eldType(3pm)
π Lucy::Plan::FieldType π
okay so bestie, this is the manual page for Lucy::Plan::FieldType from the Lucy::...eldType(3pm) page, and honestly? it's giving blueprint energy. it's a whole class about telling a field how to behave. let's get into it π
β¨ NAME β¨
Lucy::Plan::FieldType β Define a field's behavior.
like. literally that. it defines how a field acts. slay.
πΈ SYNOPSIS πΈ
my @sortable;
for my $field ( @{ $schema->all_fields } ) {
my $type = $schema->fetch_type($field);
next unless $type->sortable;
push @sortable, $field;
}
see how it's just vibing through every field and only keeping the sortable ones? main character filtering behavior fr fr π
π¦ DESCRIPTION π¦
FieldType is an abstract class β so you don't instantiate it directly, you build on top of it β and it defines a set of traits and behaviors which may be associated with one or more field names.
The properties that every single field type has in common are: boost, indexed, stored, sortable, binary, and similarity. no cap, those six are the whole personality.
boostβ a floating point scoring multiplier which defaults to1.0. Values greater than1.0make the field contribute more to a document's score, and lower values make it contribute less. it's the hype meter for your field π₯indexedβ indicates whether the field should be indexed, so that it can be searched. if it's not indexed, bestie, it is not getting found. periodt.storedβ indicates whether to store the raw field value, so that it can be retrieved when a document turns up in a search. storing = keeping the receipts π§Ύsortableβ indicates whether search results should be sortable based on the contents of the field.binaryβ indicates whether the field contains binary or text data. and here's the tea: unlike most other properties,binaryis not settable. it's read-only, it said "I'm not taking feedback" πsimilarityβ aSimilarityobject which defines matching and scoring behavior for the field. it is required if the field isindexed. so like, indexed field without a similarity? no ma'am, that's not a look.
π METHODS π
set_boost
$field_type->set_boost($boost);
Setter for boost. turn that dial up or down, your call β¨
get_boost
my $float = $field_type->get_boost();
Accessor for boost. returns a float, obviously, it's a floating point multiplier, keep up bestie π
set_indexed
$field_type->set_indexed($indexed);
Setter for indexed.
indexed
my $bool = $field_type->indexed();
Accessor for indexed.
set_stored
$field_type->set_stored($stored);
Setter for stored.
stored
my $bool = $field_type->stored();
Accessor for stored.
set_sortable
$field_type->set_sortable($sortable);
Setter for sortable.
sortable
my $bool = $field_type->sortable();
Accessor for sortable.
binary
my $bool = $field_type->binary();
Indicate whether the field contains binary data. note there's no set_binary up in here β that's the not-settable thing we talked about π«Ά
π INHERITANCE π
Lucy::Plan::FieldType isa Clownfish::Obj.
so it's got that Clownfish bloodline, iconic lineage honestly π
and that's the whole page bestie β you now know every trait, every accessor, every setter, and the one property that refuses to be set. go define some fields, you're doing amazing π β¨
kisses, this was Lucy::...eldType(3pm) from perl v5.42.0, dated 2025-07-25 β mwah ππΈ
π¦ where this page comes from
- fedora 43: perl-Lucy 0.6.2-26.fc43 Β· Apache-2.0 AND MIT AND Unicode-DFS-2015
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms