GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
KinoSearch1::Highlight::Highlighter(3) User Contributed Perl Documentation KinoSearch1::Highlight::Highlighter(3)

KinoSearch1::Highlight::Highlighter - create and highlight excerpts

    my $highlighter = KinoSearch1::Highlight::Highlighter->new(
        excerpt_field  => 'bodytext',
    );
    $hits->create_excerpts( highlighter => $highlighter );

KinoSearch1's Highlighter can be used to select a relevant snippet from a document, and to surround search terms with highlighting tags. It handles both stems and phrases correctly and efficiently, using special-purpose data generated at index-time.

    my $highlighter = KinoSearch1::Highlight::Highlighter->new(
        excerpt_field  => 'bodytext', # required
        excerpt_length => 150,        # default: 200
        formatter      => $formatter, # default: SimpleHTMLFormatter
        encoder        => $encoder,   # default: SimpleHTMLEncoder
    );

Constructor. Takes hash-style parameters:

  • excerpt_field - the name of the field from which to draw the excerpt. This field must be "vectorized".
  • excerpt_length - the length of the excerpt, in bytes. This should probably use characters as a unit instead of bytes, and the behavior is likely to change in the future.
  • formatter - an object which subclasses KinoSearch1::Highlight::Formatter, used to perform the actual highlighting.
  • encoder - an object which subclasses KinoSearch1::Highlight::Encoder. All excerpt text gets passed through the encoder, including highlighted terms. By default, this is a SimpleHTMLEncoder, which encodes HTML entities.
  • pre_tag - deprecated.
  • post_tag - deprecated.

Copyright 2005-2010 Marvin Humphrey

See KinoSearch1 version 1.01.
2022-04-08 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.