Lucy::...xtType(3pm)

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

πŸ’– 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