fix use of term count in partial terms

Term count for partial words is one less than the actual number
of words. Take that into account when adding to the search rank.

Fixes #2081.
This commit is contained in:
Sarah Hoffmann
2020-12-01 17:21:01 +01:00
parent a9357b4dce
commit df12954312

View File

@@ -344,7 +344,7 @@ class SearchDescription
) {
if ($oSearchTerm->iSearchNameCount < CONST_Max_Word_Frequency) {
$oSearch = clone $this;
$oSearch->iSearchRank += $oSearchTerm->iTermCount;
$oSearch->iSearchRank += $oSearchTerm->iTermCount + 1;
if (empty($this->aName)) {
$oSearch->iSearchRank++;
}
@@ -355,7 +355,7 @@ class SearchDescription
$aNewSearches[] = $oSearch;
} else {
$oSearch = clone $this;
$oSearch->iSearchRank++;
$oSearch->iSearchRank += $oSearchTerm->iTermCount + 1;
$oSearch->aAddressNonSearch[$iWordID] = $iWordID;
if (!empty($aFullTokens)) {
$oSearch->iSearchRank++;