Skip to content

Commit

Permalink
Item10276: quick analysis of the DebugLog data for SEARCH, and note t…
Browse files Browse the repository at this point in the history
…hat SEARCH{topic=.*} is horribly slow

git-svn-id: http://svn.foswiki.org/trunk/MongoDBPlugin@10593 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
SvenDowideit authored and SvenDowideit committed Jan 24, 2011
1 parent b0e644f commit a1a9f82
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Foswiki/Store/SearchAlgorithms/MongoDB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ sub _webQuery {
my $includeTopicsRegex =
Foswiki::Search::MongoDBInfoCache::convertTopicPatternToRegex(
$options->{topic} );
if ( $includeTopicsRegex ne '' ) {
#print STDERR "-------------------- _topic => $includeTopicsRegex (".$options->{topic}.")\n";
if (( $includeTopicsRegex ne '' ) and
($includeTopicsRegex ne '.*')){
$includeTopicsRegex = qr/$includeTopicsRegex/;
$ixhQuery->Push( '_topic' => $includeTopicsRegex );
}
Expand All @@ -181,6 +183,7 @@ sub _webQuery {
my $excludeTopicsRegex =
Foswiki::Search::MongoDBInfoCache::convertTopicPatternToRegex(
$options->{excludetopic} );
#print STDERR "--------------------2 _topic => $includeTopicsRegex\n";
if ( $excludeTopicsRegex ne '' ) {
$excludeTopicsRegex = qr/$excludeTopicsRegex/;
$ixhQuery->Push( '_topic' =>
Expand Down Expand Up @@ -242,6 +245,7 @@ sub _webQuery {
}

#remove pointless regex..
#TODO: need to work out wtf '\.*'
$raw_searchString = undef if ($raw_searchString eq '.*');
$topic_searchString = undef if ($topic_searchString eq '.*');

Expand Down

0 comments on commit a1a9f82

Please sign in to comment.