-
-
30 Sep 2014 01:32:42 UTC
- Distribution: Lucy
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Clone repository
- Issues
- Testers (28 / 33 / 3)
- Kwalitee
Bus factor: 1- License: apache_2_0
- Perl: v5.8.3
- Activity
24 month- Tools
- Download (1.06MB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- The Apache Lucy Project <dev at lucy dot apache dot org>
- Dependencies
- Clownfish
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Lucy::Plan::Schema - User-created specification for an inverted index.
SYNOPSIS
use Lucy::Plan::Schema; use Lucy::Plan::FullTextType; use Lucy::Analysis::EasyAnalyzer; my $schema = Lucy::Plan::Schema->new; my $easyanalyzer = Lucy::Analysis::EasyAnalyzer->new( language => 'en', ); my $type = Lucy::Plan::FullTextType->new( analyzer => $easyanalyzer, ); $schema->spec_field( name => 'title', type => $type ); $schema->spec_field( name => 'content', type => $type );
DESCRIPTION
A Schema is a specification which indicates how other entities should interpret the raw data in an inverted index and interact with it.
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 = Lucy::Plan::Schema->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.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 as an array.
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 creates an Architecture object for this index.
get_architecture()
Return the Schema instance's internal Architecture object.
get_similarity()
Return the Schema instance's internal Similarity object.
INHERITANCE
Lucy::Plan::Schema isa Clownfish::Obj.
Module Install Instructions
To install Lucy::Simple, copy and paste the appropriate command in to your terminal.
cpanm Lucy::Simple
perl -MCPAN -e shell install Lucy::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.