-
-
29 Sep 2010 18:00:56 UTC
- Development release
- Distribution: KinoSearch
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (5)
- Testers (122 / 14 / 1)
- Kwalitee
Bus factor: 0- License: perl_5
- Activity
24 month- Tools
- Download (841.91KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- Marvin Humphrey <marvin at rectangular dot com>
- Dependencies
- JSON::XS
- Lingua::Stem::Snowball
- Lingua::StopWords
- Parse::RecDescent
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
KinoSearch::Plan::Schema - User-created specification for an inverted index.
SYNOPSIS
use KinoSearch::Plan::Schema; use KinoSearch::Plan::FullTextType; use KinoSearch::Analysis::PolyAnalyzer; my $schema = KinoSearch::Plan::Schema->new; my $polyanalyzer = KinoSearch::Analysis::PolyAnalyzer->new( language => 'en', ); my $type = KinoSearch::Plan::FullTextType->new( analyzer => $polyanalyzer, ); $schema->spec_field( name => 'title', type => $type ); $schema->spec_field( name => 'content', type => $type );
DESCRIPTION
A Schema is a blueprint specifying how other entities should interpret the raw data in an inverted index and interact with it. It's akin to an SQL table definition.
Once an actual index has been created using a particular Schema, existing field definitions may not be changed. However, it is possible to add new fields during subsequent indexing sessions.
CONSTRUCTORS
new()
my $schema = MySchema->new;
Constructor. Takes no arguments.
METHODS
spec_field( [labeled params] )
Define the behavior of a field by associating it with a FieldType.
If this method has already been called for the supplied
field
, it will merely test to verify that the supplied FieldType equals() the existing one, then return.name - The name of the field.
type - A FieldType.
num_fields()
Return the number of fields currently defined.
all_fields()
Return all the Schema's field names.
fetch_type(field)
Return the FieldType for the specified field. If the field can't be found, return undef.
fetch_sim(field)
Return the Similarity for the specified field, or undef if either the field can't be found or it isn't associated with a Similarity.
architecture()
Factory method which returns the Architecture for this index.
get_architecture()
Return the Schema instance's internal Architecture object.
get_similarity()
Return the Schema instance's internal Similarity object.
INHERITANCE
KinoSearch::Plan::Schema isa KinoSearch::Object::Obj.
COPYRIGHT AND LICENSE
Copyright 2005-2010 Marvin Humphrey
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install KSx::Simple, copy and paste the appropriate command in to your terminal.
cpanm KSx::Simple
perl -MCPAN -e shell install KSx::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.