KinoSearch::FieldSpec - Define a field's behavior.
Define your custom subclass:
package MySchema::Price;
use base qw( KinoSearch::FieldSpec );
sub analyzed { 0 }
sub indexed { 1 }
sub stored { 1 }
sub analyzed { 0 }
sub vectorized { 0 }
sub binary { 0 }
sub compressed { 0 }
Then, arrange for your subclass of KinoSearch::Schema to load it.
package MySchema; use base qw( KinoSearch::Schema ); our %fields = ( name => 'text', price => 'MySchema::Price', );
FieldSpec is an abstract class defining a set of traits and behaviors which may be associated with one or more field names.
Returns a multiplier which determines how much a field contributes to a document's score. Default 1.0.
By default, analyzer() returns undef, 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 a KinoSearch::Analysis::Analyzer.
Expert API. Returns undef by default. Override if you want this field to use a custom subclass of KinoSearch::Search::Similarity rather than the Schema's default.
Indicate whether the field should be indexed (so that it can be searched).
Indicate whether to store the raw field value, so that it can be retrieved when a document turns up in a search.
Indicate whether to analyze the field using the relevant Analyzer.
Fields such as "category" or "product_number" might be
indexed but not analyzed.
Indicate whether to store the field's "term vectors", which are required by KinoSearch::Highlight::Highlighter for excerpt selection and search term highlighting.
Term vectors require a fair amount of space, so you should turn this off if you don't need it.
Indicate whether the field contains binary data (rather than text).
Indicate whether to compress the stored field using the zlib compression algorithm.
KinoSearch::FieldSpec isa KinoSearch::Obj.
Copyright 2005-2008 Marvin Humphrey
See KinoSearch version 0.20.