From 9a9b579a79463369319f9613a630625a99eeded0 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Sat, 28 Jul 2012 10:50:26 +0200 Subject: Fix index histogram minlen parameter for metadata keys This includes a test for the minlen parameter for metadata keys --- inc/indexer.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'inc/indexer.php') diff --git a/inc/indexer.php b/inc/indexer.php index d8768d3ab..c28499d68 100644 --- a/inc/indexer.php +++ b/inc/indexer.php @@ -755,13 +755,15 @@ class Doku_Indexer { $val_idx = array(); foreach ($index as $wid => $line) { $freq = $this->countTuples($line); - if ($freq >= $min && (!$max || $freq <= $max) && strlen($val) >= $minlen) + if ($freq >= $min && (!$max || $freq <= $max)) $val_idx[$wid] = $freq; } if (!empty($val_idx)) { $words = $this->getIndex($metaname.'_w', ''); - foreach ($val_idx as $wid => $freq) - $result[$words[$wid]] = $freq; + foreach ($val_idx as $wid => $freq) { + if (strlen($words[$wid]) >= $minlen) + $result[$words[$wid]] = $freq; + } } } else { -- cgit v1.2.3