tweaking condition for exact phrase search, a=chris
tweaking condition for exact phrase search, a=chris
diff --git a/lib/phrase_parser.php b/lib/phrase_parser.php
index ce5308872..2874b41da 100755
--- a/lib/phrase_parser.php
+++ b/lib/phrase_parser.php
@@ -166,6 +166,15 @@ class PhraseParser
|| $num > SUFFIX_TREE_THRESHOLD) {
$terms = array($whole_phrase, $terms[0]);
return $terms;
+ } else if ($count_whole_phrase > 0) {
+ foreach($terms as $term) {
+ $count_term = IndexManager::numDocsTerm($term,
+ $index_name, $threshold);
+ if($count_term > 100 * $count_whole_phrase) {
+ $terms = array($whole_phrase, $terms[0]);
+ return $terms;
+ }
+ }
}
if($index_name != 'feed' &&
IndexManager::getVersion($index_name) == 0) {