[BUGFIX] indexed_search/Indexer: correct frequency mapping for 1 93/32993/2
authorRalf Hettinger <ng@ralfhettinger.de>
Tue, 30 Apr 2013 14:15:54 +0000 (16:15 +0200)
committerMarkus Klein <klein.t3@reelworx.at>
Sat, 27 Sep 2014 10:25:22 +0000 (12:25 +0200)
There was a slight glitch in indexed_search's indexer, which resulted in
a wrong frequency mapping if the ratio between number of current word /
all words is exactly 1.
The "frequency" for this word is now mapped to the highest possible
value.

Resolves: #47745
Releases: master, 6.2
Change-Id: I1c9945b9550b80ad969f907f0bf1f14c3ae872f9
Reviewed-on: http://review.typo3.org/32993
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/indexed_search/Classes/Indexer.php

index 50c4ec9..434b8cb 100644 (file)
@@ -2018,7 +2018,7 @@ class Indexer {
         */
        public function freqMap($freq) {
                $mapFactor = $this->freqMax * 100 * $this->freqRange;
-               if ($freq < 1) {
+               if ($freq <= 1) {
                        $newFreq = $freq * $mapFactor;
                        $newFreq = $newFreq > $this->freqRange ? $this->freqRange : $newFreq;
                } else {