diff --git a/search/ranking_info.cpp b/search/ranking_info.cpp index a2bff174b77..b08b3aaf769 100644 --- a/search/ranking_info.cpp +++ b/search/ranking_info.cpp @@ -258,7 +258,10 @@ double RankingInfo::GetLinearModelRank() const result += m_falseCats * kFalseCats; result += kType[m_type]; if (Model::IsPoi(m_type)) + { + CHECK_NOT_EQUAL(m_resultType, ResultType::Count, ()); result += kResultType[base::Underlying(m_resultType)]; + } result += (m_allTokensUsed ? 1 : 0) * kAllTokensUsed; result += (m_exactCountryOrCapital ? 1 : 0) * kExactCountryOrCapital; auto const nameRank = kNameScore[nameScore] + kErrorsMade * GetErrorsMadePerToken() + diff --git a/search/search_tests/ranking_tests.cpp b/search/search_tests/ranking_tests.cpp index 3d39dd77a54..86a97b58d1c 100644 --- a/search/search_tests/ranking_tests.cpp +++ b/search/search_tests/ranking_tests.cpp @@ -86,6 +86,7 @@ UNIT_TEST(PreferCountry) cafe.m_tokenRanges[Model::TYPE_SUBPOI] = TokenRange(0, 1); cafe.m_exactCountryOrCapital = false; cafe.m_type = Model::TYPE_SUBPOI; + cafe.m_resultType = ResultType::Eat; auto country = info; country.m_distanceToPivot = 1e6;