diff --git a/search/ranking_info.cpp b/search/ranking_info.cpp index f1d560c795..23b278fb76 100644 --- a/search/ranking_info.cpp +++ b/search/ranking_info.cpp @@ -28,7 +28,7 @@ double constexpr kCategoriesRank = 1.0000000; double constexpr kCategoriesFalseCats = -1.0000000; double constexpr kDistanceToPivot = -0.2123693; -double constexpr kRank = 0.1065355; +double constexpr kRank = 0.15; double constexpr kPopularity = 1.0000000; // Decreased this value: @@ -36,7 +36,7 @@ double constexpr kPopularity = 1.0000000; // - On the other hand, when search for "subway", do we usually prefer famous fast food or metro? double constexpr kFalseCats = -0.01; -double constexpr kErrorsMade = -0.05; +double constexpr kErrorsMade = -0.15; double constexpr kMatchedFraction = 0.1876736; double constexpr kAllTokensUsed = 0.0478513; double constexpr kExactCountryOrCapital = 0.1247733; @@ -60,7 +60,7 @@ double constexpr kType[] = { 0, // Suburb -0.02, // Unclassified 0, // Village - 0.0073583, // City + 0.01, // City 0.0233254, // State 0.1679389, // Country }; diff --git a/search/search_quality/search_quality_tests/real_mwm_tests.cpp b/search/search_quality/search_quality_tests/real_mwm_tests.cpp index a1652d1f8e..458808bc02 100644 --- a/search/search_quality/search_quality_tests/real_mwm_tests.cpp +++ b/search/search_quality/search_quality_tests/real_mwm_tests.cpp @@ -361,4 +361,35 @@ UNIT_CLASS_TEST(MwmTestsFixture, IceCream) for (size_t i = 0; i < kResultsCount; ++i) TEST(results[i].GetFeatureID() == results2[i].GetFeatureID(), (results[i], results2[i])); } + +UNIT_CLASS_TEST(MwmTestsFixture, Hilo_City) +{ + // Istanbul, Kadikoy. + ms::LatLon const center(40.98647, 29.02552); + SetViewportAndLoadMaps(center); + + // Lets start with trailing space here. + // Prefix search is more fuzzy and gives "Hill", "Holo", .. nearby variants. + auto request = MakeRequest("Hilo "); + auto const & results = request->Results(); + size_t constexpr kResultsCount = 5; // Hilo city in Hawaii should be at the top. + TEST_GREATER(results.size(), kResultsCount, ()); + + auto const cityType = classif().GetTypeByPath({"place", "city"}); + + bool found = false; + for (size_t i = 0; i < kResultsCount; ++i) + { + auto const & r = results[i]; + if (r.GetResultType() == search::Result::Type::Feature && + r.GetString() == "Hilo" && + EqualClassifType(r.GetFeatureType(), cityType)) + { + found = true; + break; + } + } + + TEST(found, (results)); +} } // namespace real_mwm_tests