Bug #38326
closedsometimes too many results listed on page
0%
Description
In 4.7.1, when TS setup value plugin.tx_indexedsearch.search.exactCount is set to 1, the number of search results listed on one page is twice as many as would normally be the case. For instance, if results per page should be 10, actually 20 results are listed. (The next page does start at the right position, though.)
This behavior seems to have something to do with function getResultRows in class.tx_indexedsearch.php: if the value of $lastResultNumberToAnalyze (see line 537) is changed from
$lastResultNumberToAnalyze = ($currentPageNumber + 1) * $this->piVars['results'] + $this->piVars['results'];
to
$lastResultNumberToAnalyze = ($currentPageNumber + 1) * $this->piVars['results']
the number of results comes out right. However, I am not sure if that is the appropriate solution.
(Additional comment: when comparing the calculation of $lastResultNumberOnPreviousPage and $firstResultNumberOnNextPage in that same function getResultRows, on lines 535-536, and given how $firstResultNumberOnNextPage is used on line 582, it would seem that $firstResultNumberOnNextPage actually represents the last result number on the current page.)