KinoSe...lighter(3pm)
π NAME π
KinoSearch1::Highlight::Highlighter β bestie, it makes excerpts and then highlights them β¨
(Also hi, this page lives in the 3pm section of the manual β user contributed perl docs, iykyk π
)
π SYNOPSIS π
okay so first you build a highlighter, then you let it cook:
my $highlighter = KinoSearch1::Highlight::Highlighter->new(
excerpt_field => 'bodytext',
);
$hits->create_excerpts( highlighter => $highlighter );
πΈ DESCRIPTION πΈ
So the Highlighter in KinoSearch1 has one job and it EATS: it picks a relevant little snippet out of a document, and then it wraps your search terms in highlighting tags. π«Ά
And the way it handles both stems and phrases? Correctly. Efficiently. Both. It uses special-purpose data that got generated back at index-time, so it's not out here guessing β it's giving prepared, main character energy π
β¨ METHODS β¨
π new
my $highlighter = KinoSearch1::Highlight::Highlighter->new(
excerpt_field => 'bodytext', # required
excerpt_length => 150, # default: 200
formatter => $formatter, # default: SimpleHTMLFormatter
encoder => $encoder, # default: SimpleHTMLEncoder
);
The constructor π§ it takes hash-style parameters, which is to say, named args:
excerpt_fieldβ the name of the field you're pulling the excerpt from. Lowkey important: this field must be "vectorized". No vector, no excerpt, periodt.excerpt_lengthβ how long the excerpt is, measured in bytes. And ngl, this should probably be measured in characters instead of bytes, and the behavior is likely to change in the future. So don't get too attached π₯formatterβ an object that subclassesKinoSearch1::Highlight::Formatter. It's the one doing the actual highlighting. Defaults toSimpleHTMLFormatter.encoderβ an object that subclassesKinoSearch1::Highlight::Encoder. All excerpt text gets passed through the encoder, including the highlighted terms. Default is aSimpleHTMLEncoder, which encodes HTML entities β¨pre_tagβ deprecated πpost_tagβ deprecated π
Heads up bestie:pre_tagandpost_tagare deprecated. Don't build your whole vibe on them.
π COPYRIGHT π
Copyright 2005-2010 Marvin Humphrey
π LICENSE, DISCLAIMER, BUGS, etc. π
See KinoSearch1 version 1.01.
And that's the whole page, bestie β no skips, no summaries, we ate π
Perl v5.42.3, dated 2026-08-20, from the KinoSe...lighter(3pm) page. Mwah π
π¦ where this page comes from
- ubuntu stonking: libkinosearch1-perl 1.01-6build2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms