NAME

Dezi::InvIndex - base class for Dezi inverted indexes

SYNOPSIS

use Dezi::InvIndex;
my $index = Dezi::InvIndex->new(path => 'path/to/index');
print $index;  # prints $index->path
my $header = $index->get_header();  # $meta isa Dezi::InvIndex::Header object

DESCRIPTION

A Dezi::InvIndex is a base class for defining different inverted index formats.

METHODS

new

Constructor.

new_from_header

Instantiates an InvIndex object in the correct subclass based on the Index Format in the InvIndex header file.

Example:

my $invindex = Dezi::InvIndex->new('path/to/lucy.index');
# $invindex isa Dezi::Lucy::InvIndex

path

Returns a Path::Class::Dir object representing the directory path to the index. The path is a directory which contains the various files that comprise the index.

get_header

Returns a Dezi::InvIndex::Header object with which you can query information about the index.

header_file

Returns Path::Class::File object pointing at the header_file.

open

Open the invindex for reading/writing. Subclasses should implement this per their IR library specifics.

This base open() method will rmtree( path() ) if clobber() is true, and will mkpath() if path() does not exist. So SUPER::open() should do something sane at minimum.

open_ro

Open the invindex in read-only mode. This is typical when searching the invindex.

The default open_ro() method will simply call through to open().

close

Close the index. Subclasses should implement this per their IR library specifics.

clobber

Get/set the boolean indicating whether the index should overwrite any existing index with the same name. The default is true.

new_from_meta

Returns a new instance like new() does, blessed into the appropriate class indicated by the swish.xml meta header file.

AUTHOR

Peter Karman, <karpet@dezi.org>

BUGS

Please report any bugs or feature requests to bug-dezi-app at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Dezi-App. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Dezi::InvIndex

You can also look for information at:

COPYRIGHT AND LICENSE

Copyright 2014 by Peter Karman

This library is free software; you can redistribute it and/or modify it under the terms of the GPL v2 or later.

SEE ALSO

http://dezi.org/, http://swish-e.org/, http://lucy.apache.org/