Fix multiword search in IndexArchiveBundle
Fix multiword search in IndexArchiveBundle
diff --git a/lib/index_archive_bundle.php b/lib/index_archive_bundle.php
index 86f3083f1..5835fb869 100644
--- a/lib/index_archive_bundle.php
+++ b/lib/index_archive_bundle.php
@@ -711,13 +711,14 @@ class IndexArchiveBundle implements IndexingConstants, CrawlConstants
if($phrase_key == NULL) {
$phrase_key = $word_key;
}
-
+
if($phrase_info == NULL) {
- $phrase_info = $this->getPhraseIndexInfo($phrase_key);
+ $phrase_info = $this->getPhraseIndexInfo($phrase_key);
}
if($phrase_info == NULL || (isset($phrase_info[self::PARTIAL_COUNT])
&& $phrase_info[self::PARTIAL_COUNT] < $limit + $num)) {
+
$this->addPhraseIndex(
$word_key, $restrict_phrases, $phrase_key, $limit + $num);
}
@@ -1022,7 +1023,11 @@ class IndexArchiveBundle implements IndexingConstants, CrawlConstants
}
/**
+ * Gets teh description, count of summaries, and number of partions of the
+ * summaries store in the supplied directory
*
+ * @param string path to a directory containing a summaries WebArchiveBundle
+ * @return array summary of the given archive
*/
public static function getArchiveInfo($dir_name)
{
diff --git a/models/phrase_model.php b/models/phrase_model.php
index 0905f6576..7fdc97161 100755
--- a/models/phrase_model.php
+++ b/models/phrase_model.php
@@ -112,6 +112,11 @@ class PhraseModel extends Model
$phrase_hash = crawlHash($phrase_string);
$phrase_info = $index_archive->getPhraseIndexInfo($phrase_hash);
+ if(isset($phrase_info[IndexingConstants::PARTIAL_COUNT]) &&
+ $phrase_info[IndexingConstants::PARTIAL_COUNT] <
+ $low + $results_per_page) {
+ $phrase_info = NULL;
+ }
if($phrase_info != NULL) {