From 5a1d05488ca6e176af4d195accbdca8010cf3416 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Wed, 11 Dec 2013 23:02:17 +0100 Subject: Fix indexing numeric words in page contents Since a8dba4523d2ecd09dd69a68a36673eaf5c009c57 the search index didn't properly index numeric words anymore, instead they were added as new words to the word list each time they were indexed, leading to an ever-increasing index size. --- inc/indexer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'inc/indexer.php') diff --git a/inc/indexer.php b/inc/indexer.php index 658fb966b..07f29b542 100644 --- a/inc/indexer.php +++ b/inc/indexer.php @@ -10,7 +10,7 @@ if(!defined('DOKU_INC')) die('meh.'); // Version tag used to force rebuild on upgrade -define('INDEXER_VERSION', 7); +define('INDEXER_VERSION', 8); // set the minimum token length to use in the index (note, this doesn't apply to numeric tokens) if (!defined('IDX_MINWORDLENGTH')) define('IDX_MINWORDLENGTH',2); @@ -215,6 +215,7 @@ class Doku_Indexer { foreach (array_keys($words) as $wlen) { $word_idx = $this->getIndex('w', $wlen); foreach ($words[$wlen] as $word => $freq) { + $word = (string)$word; $wid = array_search($word, $word_idx, true); if ($wid === false) { $wid = count($word_idx); -- cgit v1.2.3