
Metadata::DB::Search - search the indexed metadata

use Metadata::DB::Search;
use Metadata::DB;
my $s = Metadata::DB::Search->new({ DBH => $dbh });
$s->search({
'age:exact' => 24,
'first_name:like' => 'jo',
'speed:morethan' => 40,
});
$s->ids_count or die('nothing found');
for(@$ids) {
my $o = new Metadata::DB({ DBH => $dbh, id => $_ });
}

my $s = Metadata::DB::Search->new({ DBH => $dbh });
$s->search_params_add( age => 24 );
$s->search_params_add( 'first_name:like' =>'jo' );
$s->search;
my @matching_ids = @{ $s->ids };
for my $id ( @matching_ids ){
}

What if you want to search other metadata table?
$s->table_metadata_name('people');
$s->search({
'age:exact' => 24,
'first_name:like' => 'jo',
});

optional argument is a hash ref with search params these are key value pairs the value can be a string or an array ref
$s->search({
age => 25,
'name:exact' => ['larry','joe']
});
Possible search types for each attribute are like, exact, morethan, lessthan, default is like.
returns array ref of matching ids, results, in metadata table that meet the criteria
returns count of how many search results we have
returns how many search params we have
returns array ref of what the search params were for the search
experimental, arg is number, may help speed up searches if set, possible num is 100?


This is a work in progress.

Please contact the AUTHOR of any bugs.

Leo Charre leocharre at cpan dot org