Index: trunk/extensions/LuceneSearch.php |
— | — | @@ -41,6 +41,9 @@ |
42 | 42 | $wgLuceneDisableSuggestions = false; |
43 | 43 | $wgLuceneDisableTitleMatches = false; |
44 | 44 | |
| 45 | +/** Number of seconds to cache query results */ |
| 46 | +$wgLuceneCacheExpiry = 60 * 15; |
| 47 | + |
45 | 48 | # Not a valid entry point, skip unless MEDIAWIKI is defined |
46 | 49 | if (!defined('MEDIAWIKI')) { |
47 | 50 | die( "This file is part of MediaWiki, it is not a valid entry point\n" ); |
— | — | @@ -648,7 +651,7 @@ |
649 | 652 | // Cache results for fifteen minutes; they'll be read again |
650 | 653 | // on reloads and paging. |
651 | 654 | $key = $wgDBname.':lucene:' . md5( $searchPath ); |
652 | | - $expiry = 60 * 15; |
| 655 | + |
653 | 656 | $resultSet = $wgMemc->get( $key ); |
654 | 657 | if( is_object( $resultSet ) ) { |
655 | 658 | wfDebug( "$fname: got cached lucene results for key $key\n" ); |
— | — | @@ -716,7 +719,8 @@ |
717 | 720 | $resultSet = new LuceneSearchSet( $resultLines, $totalHits, $suggestion ); |
718 | 721 | |
719 | 722 | wfDebug( $fname.": caching lucene results for key $key\n" ); |
720 | | - $wgMemc->add( $key, $resultSet, $expiry ); |
| 723 | + global $wgLuceneCacheExpiry; |
| 724 | + $wgMemc->add( $key, $resultSet, $wgLuceneCacheExpiry ); |
721 | 725 | |
722 | 726 | wfProfileOut( $fname ); |
723 | 727 | return $resultSet; |