Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tm::index::match(3pm) [debian man page]

TM::Index::Match(3pm)					User Contributed Perl Documentation				     TM::Index::Match(3pm)

NAME
TM::Index::Match - Topic Maps, Indexing support (match layer) SYNOPSIS
# somehow get a map (any subclass of TM will do) my $tm = ... # one option: create a lazy index which learns as you go use TM::Index::Match; my $idx = new TM::Index::Match ($tm); # for most operations which involve match_forall to be called # reading and querying the map should be much faster # learn about some statistics, what keys are most likely to be useful my @optimized_keys = @{ $stats->{proposed_keys} }; # another option: create an eager index my $idx = new TM::Index::Match ($tm, closed => 1); # pre-populate it, use the proposed keys $idx->populate (@optimized_keys); # this may be a lengthy operation if the map is big # but then the index is 'complete' # query map now, should also be faster # getting rid of an index explicitly $idx->detach; # cleaning an index $idx->discard; DESCRIPTION
This index implements a generic query cache which can capture all queries not handled by more specific indices. This class inherits directly from TM::Index. INTERFACE
Constructor The constructor/destructors are the same as that described in TM::Index. Methods populate $idx->populate (@list_of_keys) To populate the index with canned results this method can be invoked. At this stage it is not very clever and may take quite some time to work its way through a larger map. This is most likely something to be done in the background. The list of keys to be passed in is a bit black magic. Your current best bet is to look at the index statistics method, and retrieve a proposed list from there: @optimized_keys = @{ $stats->{proposed_keys} }; $idx->populate (@optimized_keys[0..2]); # only take the first few If this list is empty, nothing clever will happen. statistics $hashref = $idx->statistics This returns a hash containing statistical information about certain keys, how much data is behind them, how often they are used when adding information to the index, how often data is read out successfully. The "cost" component can give you an estimated about the cost/benefit. SEE ALSO
TM, TM::Index COPYRIGHT AND LICENSE
Copyright 200[6] by Robert Barta, <drrho@cpan.org> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2008-04-10 TM::Index::Match(3pm)

Check Out this Related Man Page

Plucene::Index::Writer(3pm)				User Contributed Perl Documentation			       Plucene::Index::Writer(3pm)

NAME
Plucene::Index::Writer - write an index. SYNOPSIS
my $writer = Plucene::Index::Writer->new($path, $analyser, $create); $writer->add_document($doc); $writer->add_indexes(@dirs); $writer->optimize; # called before close my $doc_count = $writer->doc_count; my $mergefactor = $writer->mergefactor; $writer->set_mergefactor($value); DESCRIPTION
This is the writer class. If an index will not have more documents added for a while and optimal search performance is desired, then the "optimize" method should be called before the index is closed. METHODS
new my $writer = Plucene::Index::Writer->new($path, $analyser, $create); This will create a new Plucene::Index::Writer object. The third argument to the constructor determines whether a new index is created, or whether an existing index is opened for the addition of new documents. mergefactor / set_mergefactor my $mergefactor = $writer->mergefactor; $writer->set_mergefactor($value); Get / set the mergefactor. It defaults to 5. doc_count my $doc_count = $writer->doc_count; add_document $writer->add_document($doc); Adds a document to the index. After the document has been added, a merge takes place if there are more than $Plucene::Index::Writer::mergefactor segments in the index. This defaults to 10, but can be set to whatever value is optimal for your application. optimize $writer->optimize; Merges all segments together into a single segment, optimizing an index for search. This should be the last method called on an indexer, as it invalidates the writer object. add_indexes $writer->add_indexes(@dirs); Merges all segments from an array of indexes into this index. This may be used to parallelize batch indexing. A large document collection can be broken into sub-collections. Each sub-collection can be indexed in parallel, on a different thread, process or machine. The complete index can then be created by merging sub-collection indexes with this method. After this completes, the index is optimized. perl v5.12.4 2011-08-14 Plucene::Index::Writer(3pm)
Man Page