Marvin Humphrey > KinoSearch1-1.01 > KinoSearch1::Highlight::Highlighter

Download:
KinoSearch1-1.01.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

NAME ^

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

SYNOPSIS ^

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

DESCRIPTION ^

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.

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
    );

Constructor. Takes hash-style parameters:

COPYRIGHT ^

Copyright 2005-2010 Marvin Humphrey

LICENSE, DISCLAIMER, BUGS, etc. ^

See KinoSearch1 version 1.01.

syntax highlighting: