--- lib/TWiki/Contrib/DBCacheContrib/Search.pm 2007-11-14 17:46:27.000000000 +0100 +++ lib/TWiki/Contrib/DBCacheContrib/Search.pm 2007-11-14 18:47:01.000000000 +0100 @@ -64,6 +64,7 @@ ( 'lc' => 5, 'uc' => 5, + 'type' => 5, '=' => 4, '=~' => 4, '!=' => 4, @@ -82,7 +83,7 @@ my $bopRE = "AND\\b|OR\\b|!=|=~?|<=?|>=?|LATER_THAN\\b|EARLIER_THAN\\b|WITHIN_DAYS\\b|IS_DATE\\b"; -my $uopRE = "!|[lu]c\\b"; +my $uopRE = "!|[lu]c\\b|type\\b"; my $now = time(); @@ -274,6 +275,17 @@ return TWiki::Time::formatTime( $r->matches( $map ), '$email', 'gmtime' ); }; + if ($op eq "type") { + my $type=$r->matches( $map ); + my $form=$map->fastget('form'); + return 0 if(not defined $form); + return 1 if($map->fastget('form') eq $type); + my $base=$map->fastget('base'); + return 0 if(not defined $base); + # TODO: use web regexp instead of [A-Za-z] + return 1 if(grep(/[^|,]\s*[A-Za-z]+\.$type\s*/,$base->getValues())); + return 0; + }; return 0 unless (defined $l);