Lucy::...eldType(3pm)

πŸ“¦
version 0.6.2 Β· 2 versions
, in fedora 43

πŸ’– 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 to 1.0. Values greater than 1.0 make 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, binary is not settable. it's read-only, it said "I'm not taking feedback" πŸ™ˆ
  • similarity β€” a Similarity object which defines matching and scoring behavior for the field. it is required if the field is indexed. 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