Lucy::...xtType(3pm)
π NAME π
Lucy::Plan::FullTextType β the full-text search field type, bestie. That's it, that's the whole vibe. It's the field type you reach for when you want to actually search words instead of matching strings exactly. β¨
π¦ SYNOPSIS π¦
okay so here's the whole thing in action, look at it:
my $easyanalyzer = Lucy::Analysis::EasyAnalyzer->new(
language => 'en',
);
my $type = Lucy::Plan::FullTextType->new(
analyzer => $easyanalyzer,
);
my $schema = Lucy::Plan::Schema->new;
$schema->spec_field( name => 'title', type => $type );
$schema->spec_field( name => 'content', type => $type );
see how we build the analyzer, hand it to the type, and then spec out title and content with it? yeah. that's the move. π
πΈ DESCRIPTION πΈ
Lucy::Plan::FullTextType is an implementation of FieldType that's tuned specifically for "full text search". it's giving main character energy in the search world, fr fr.
Full text fields are associated with an Analyzer, and that analyzer is the one doing the tokenize-and-normalize thing so your text can actually be searched for individual words. no analyzer, no word-level searching, iykyk. π
if what you actually want is an exact-match, single value field type using character data, then go look at StringType instead. different tool, different job, no hard feelings. π«Ά
π CONSTRUCTORS π
β¨ new β¨
my $type = Lucy::Plan::FullTextType->new(
analyzer => $analyzer, # required
boost => 2.0, # default: 1.0
indexed => 1, # default: true
stored => 1, # default: true
sortable => 1, # default: false
highlightable => 1, # default: false
);
here's what each one means, one by one, no skipping:
analyzerβ an Analyzer. this one's required, so don't come to the function empty-handed bestie. π«Άboostβ floating point per-field boost. yes, it's a number, yes it makes your field hit different in the rankings. β¨indexedβ boolean indicating whether the field should be indexed.storedβ boolean indicating whether the field should be stored.sortableβ boolean indicating whether the field should be sortable.highlightableβ boolean indicating whether the field should be highlightable.
π METHODS π
π set_highlightable π
$full_text_type->set_highlightable($highlightable);
indicate whether to store the data that Highlighter needs for excerpt selection and search term highlighting. so if you want the pretty highlight-y moments later, you set this. β
π highlightable π
my $bool = $full_text_type->highlightable();
accessor for the "highlightable" property. just hands you the bool, no drama. π
π§ get_analyzer π§
my $analyzer = $full_text_type->get_analyzer();
accessor for the type's analyzer. this is how you get your analyzer back out of the type. iconic. π
π INHERITANCE π
Lucy::Plan::FullTextType isa Lucy::Plan::TextType isa Lucy::Plan::FieldType isa Clownfish::Obj.
a whole little family tree, and yes, it goes all the way up. π
and that's the page!! this was Lucy::...xtType(3pm) from the User Contributed Perl Documentation, written by perl itself at v5.42.0 on 2025-07-25 β mwah, thanks for reading, love u, bye πβ¨π¦
π¦ 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