Marvin Humphrey > KinoSearch > KinoSearch::Highlight::Highlighter

Download:
KinoSearch-0.165.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  7
View Bugs
Report a bug
Source  

NAME ^

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

SYNOPSIS ^

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

DESCRIPTION ^

KinoSearch'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.

METHODS ^

new

    my $highlighter = KinoSearch::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:

COPYRIGHT ^

Copyright 2005-2009 Marvin Humphrey

LICENSE, DISCLAIMER, BUGS, etc. ^

See KinoSearch version 0.165.