Search::InvertedIndex::Simple::BerkeleyDB is a pure Perl module.
See the parent module Search::InvertedIndex::Simple for an explanation of the options dataset and keyset passed in to new().
db_put() writes the index built by Search::InvertedIndex::Simple to an in-RAM database managed by BerkeleyDB.
db_get($key) returns the results of a search as a hash ref.
inflate($result) converts the result hash ref into a single object of type Set::Array.
Synopsis
my($dataset) = [
{ # Index: 0.
address => 'Here',
event => 'End',
time => 'Time',
},
{ # Index: 1.
address => 'Heaven',
event => 'Exit',
time => 'Then',
},
{ # Index: 2.
address => 'House',
event => 'Finish',
time => 'Thus',
}
];
my($keyset) = [qw/address time/];
my($db) = Search::InvertedIndex::Simple::BerkeleyDB -> new
(
dataset => $dataset,
keyset => $keyset,
);
$db -> db_put();
my($result) = $db -> db_get({address => 'Hea', time => 'T'}); # Returns a hashref.
my($set) = $db -> inflate($result); # Returns a Set::Array object.
print $set ? join(',', $set -> print() ) : 'Search did not find any matching records', ". \n";
Product's homepage
Requirements:
· Perl