The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

KinoSearch::Schema::FieldSpec -- Define a field's behavior.

SYNOPSIS

Define your custom subclass:

    package MySchema::price;
    use base qw( KinoSearch::Schema::FieldSpec )
    sub analyzed { 0 }

Then, arrange for your subclass of KinoSearch::Schema to load it.

    package MySchema;
    use base qw( KinoSearch::Schema );
    __PACKAGE__->init_fields(qw( name price id description ))

DESCRIPTION

KinoSearch::Schema::FieldSpec is an API for associating attributes and behaviors with a field name. To create a field, subclass FieldSpec; to customize it, override one or more of the default methods.

CLASS METHODS

indexed

Returns a boolean indicating whether the field should be indexed, so that it can be searched later. Default true.

analyzed

Returns a boolean indicating whether to analyze the field using the relevant Analyzer. Default true.

Fields such as "category" or "product_number" might be indexed but not analyzed.

stored

Store the raw field value, so that it can be retrieved when the document turns up in a search. Default true.

compressed

Compress the stored field, using the zlib compression algorithm. Default false.

vectorized

Store the field's "term vectors", which are required by KinoSearch::Highlight::Highlighter for excerpt selection and search term highlighting. Default true.

Term vectors require a fair amount of space, so you should turn this off if you don't need it.

boost

A multiplier which determines how much a field contributes to a document's score. Default 1.0.

analyzer

By default, analyzer() has no return value, which indicates that the Schema's default analyzer should be used for this field. If you want a given field to use a different analyzer, override this method and have it return an object which isa KinoSearch::Analysis::Analyzer.

similarity

As with analyzer(), this method returns nothing by default. Override it if you want this field to use a custom subclass of KinoSearch::Search::Similarity, rather than the Schema's default.

store_pos_boost

TEMPORARY API - the capacity to store boosts per position is not going away, but the way which you will indicate it will change.

Indicate that the index should store a scoring multiplier for each and every token in this field. This is expensive, but can be useful if, for example, you want text which was emboldened or italicized in the source material to have greater weight than surrounding text. See KinoSearch::Analysis::Token.

COPYRIGHT

Copyright 2005-2007 Marvin Humphrey

LICENSE, DISCLAIMER, BUGS, etc.

See KinoSearch version 0.20_01.