[BUGFIX] indexed_search/Indexer: correct frequency mapping for 1 56/20356/4
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:24:59 +0000 (12:24 +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/20356
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/indexed_search/Classes/Indexer.php

index 6937995..c964a51 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 {