KinoSearch::Schema::FieldSpec - Define a field's behavior.
Define your custom subclass:
package MySchema::UnAnalyzed; 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 ); our %fields = ( name => 'KinoSearch::Schema::FieldSpec', price => 'MySchema::UnAnalyzed', );
A FieldSpec defines a set of traits and behaviors which may be associated with one or more field names. If the default behaviors are not appropriate for a given field, FieldSpec may be subclassed.
Returns a boolean indicating whether the field should be indexed, so that it can be searched later. Default true.
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.
Returns a boolean indicating whether to store the raw field value, so that it can be retrieved when the document turns up in a search. Default true.
Returns a boolean indicating whether to compress the stored field, using the zlib compression algorithm. Default false.
Returns a boolean indication whether to 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.
Returns a multiplier which determines how much a field contributes to a document's score. Default 1.0.
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.
Expert API. 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.
EXPERIMENTAL - the capacity to specify different posting types is not going away, but the interface is likely to change.
Expert API. Indicates what subclass of Posting the field should use. The default is the general-purpose KinoSearch::Posting::ScorePosting. Boolean (true/false only) fields might use KinoSearch::Posting::MatchPosting. To override, supply a class name which isa KinoSearch::Posting.
Copyright 2005-2007 Marvin Humphrey
See KinoSearch version 0.20.
To install KinoSearch, copy and paste the appropriate command in to your terminal.
cpanm
cpanm KinoSearch
CPAN shell
perl -MCPAN -e shell install KinoSearch
For more information on module installation, please visit the detailed CPAN module installation guide.