KinoSearch::InvIndex - An inverted index.
use MySchema; my $invindex = MySchema->clobber('/path/to/invindex');
"InvIndex" is short for "inverted index", the name for the data structure which KinoSearch is based around. Generically, an inverted index, as opposed to any other kind of index, contains mappings from keywords to documents, allowing you to look up a term and find out where it occurs within a collection.
A KinoSearch::InvIndex object has two main parts: a Schema and a Folder. The Schema describes how the index data is structured, and the Folder provides the I/O capabilities for actually getting at the data and doing something with it.
InvIndex provides three constructors: create(), clobber(), and open(). They all take two hash-style params.
schema - an instance of an object which isa KinoSearch::Schema.
folder - Either an object which isa KinoSearch::Store::Folder, or a filepath. If a filepath is supplied, an FSFolder object will be created.
These constructors are usually called via factory methods from Schema:
my $invindex = MySchema->clobber($filepath); # ... is the same as... my $invindex = KinoSearch::InvIndex->clobber( schema => MySchema->new, folder => KinoSearch::Store::FSFolder->new( path => $filepath ), );
However, when called directly, InvIndex's constructors allow you more flexibility in supplying the folder argument, so you can do things like supply a RAMFolder.
folder
my $invindex = KinoSearch::InvIndex->create( schema => MySchema->new, folder => $path_or_folder_obj, );
Initialize a new invindex, creating a directory on the file system if appropriate. Fails unless the Folder is empty.
my $invindex = KinoSearch::InvIndex->clobber( schema => MySchema->new, folder => $path_or_folder_obj, );
Similar to create, but firsts attempts to delete any files within the Folder that look like index files.
my $invindex = KinoSearch::InvIndex->open( schema => MySchema->new, folder => $path_or_folder_obj, );
Open an existing invindex for either reading or updating.
Getters for folder and invindex.
Copyright 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.