Perl Diver 2.33
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Plucene::Index::Reader

Name Plucene::Index::Reader
Version
Located at /usr/share/perl5
File /usr/share/perl5/Plucene/Index/Reader.pm
Is Core No
Search CPAN for this module Plucene::Index::Reader
Documentation Plucene::Index::Reader
Module Details Plucene::Index::Reader

NAME

Plucene::Index::Reader - Abstract class for accessing an index


DESCRIPTION

IndexReader is an abstract class, providing an interface for accessing an index. Search of an index is done entirely through this abstract interface, so that any subclass which implements it is searchable.

Concrete subclasses of IndexReader are usually constructed with a call to the static method open.

For efficiency, in this API documents are often referred to via document numbers, non-negative integers which each name a unique document in the index. These document numbers are ephemeral--they may change as documents are added to and deleted from an index. Clients should thus not rely on a given document having the same number between sessions.


METHODS

new

        my $reader = Plucene::Index::Reader->new($dir_name);

This will create a new Plucene::Index::Reader with the passed in directory.

open

        # If there is only one segment
        my Plucene::Index::SegmentReader $seg_read = $reader->open;
        # If there are many segments
        my Plucene::Index::SegmentsReader $seg_read = $reader->open;

Returns an IndexReader reading the index in the given Directory.

last_modified

        my $last_modified = Plucene::Index::Reader->last_modified($directory);

index_exists

        if (Plucene::Index::Reader->index_exists($directory)){ ... }

is_locked

        if (Plucene::Index::Reader->is_locked($directory)){ ... }

delete

        $reader->delete($doc);

delete_term

        $reader->delete_term($term);

This will delete all the documents which contain the passed term.


=cut

sub delete_term { my ($self, $term) = @_; my $enum = $self->term_docs($term); $self->delete($enum->doc) while $enum->next; }

close

        $reader->close;

unlock

        $reader->unlock($directory);

num_docs / max_doc / document / is_deleted / norms / terms / doc_freq / term_docs / term_positions / _do_delete / _do_close

These must be defined in a subclass

Perl Diver brought to you by ScriptSolutions.com © 1997- 2026