diff --git a/indexer/feature_visibility.cpp b/indexer/feature_visibility.cpp index 82db7e4885..812378fb52 100644 --- a/indexer/feature_visibility.cpp +++ b/indexer/feature_visibility.cpp @@ -250,7 +250,6 @@ namespace static uint32_t const shuttle = cl.GetTypeByPath({"route", "shuttle_train"}); static uint32_t const internet = cl.GetTypeByPath({"internet_access"}); - static uint32_t const organic = cl.GetTypeByPath({"organic"}); static uint32_t const complexEntry = cl.GetTypeByPath({"complex_entry"}); if ((g == GeomType::Line || g == GeomType::Undefined) && type == shuttle) @@ -261,9 +260,19 @@ namespace if (g != GeomType::Line) { - // Exclude generic 1-arity types like [organic]. - if (type == internet || (type == organic && typeLevel >= 2)) + if (type == internet) return true; + + // Exclude generic 1-arity types like [organic]. + if (typeLevel >= 2) + { + static uint32_t const arrTypes[] = { + cl.GetTypeByPath({"organic"}), + cl.GetTypeByPath({"recycling"}) + }; + if (base::IsExist(arrTypes, type)) + return true; + } } return (type == complexEntry); @@ -298,17 +307,9 @@ namespace static uint32_t const arrTypes[] = { cl.GetTypeByPath({"wheelchair"}), - cl.GetTypeByPath({"cuisine"}), - cl.GetTypeByPath({"recycling"}) + cl.GetTypeByPath({"cuisine"}) }; - - for (uint32_t t : arrTypes) - { - if (t == type) - return true; - } - - return false; + return base::IsExist(arrTypes, type); } /// @} } // namespace diff --git a/search/search_integration_tests/processor_test.cpp b/search/search_integration_tests/processor_test.cpp index 7bf4c29605..98bb26d698 100644 --- a/search/search_integration_tests/processor_test.cpp +++ b/search/search_integration_tests/processor_test.cpp @@ -1609,6 +1609,34 @@ UNIT_CLASS_TEST(ProcessorTest, OrganicTest) TEST_EQUAL(GetResultsNumber("органическая обувь", "ru"), 0, ()); } +UNIT_CLASS_TEST(ProcessorTest, RecyclingTest) +{ + string const countryName = "Wonderland"; + + TestPOI paper(m2::PointD(1.0, 1.0), "Макулатура", "ru"); + paper.SetTypes({{"amenity", "recycling", "container"}, {"recycling", "paper"}}); + + TestPOI metal(m2::PointD(1.0, 1.0), "Armatura", "en"); + metal.SetTypes({{"amenity", "recycling", "centre"}, {"recycling", "scrap_metal"}}); + + auto countryId = BuildCountry(countryName, [&](TestMwmBuilder & builder) { + builder.Add(paper); + builder.Add(metal); + }); + + SetViewport(m2::RectD(-1, -1, 1, 1)); + + { + Rules rules{ExactMatch(countryId, paper), ExactMatch(countryId, metal)}; + TEST(ResultsMatch("прием вторсырья", "ru", rules), ()); + } + { + Rules rules{ExactMatch(countryId, paper)}; + TEST(ResultsMatch("прием бумаги", "ru", rules), ()); + } + TEST_EQUAL(GetResultsNumber("прием обуви", "ru"), 0, ()); +} + UNIT_CLASS_TEST(ProcessorTest, AirportTest) { string const countryName = "Wonderland"; diff --git a/search/search_integration_tests/smoke_test.cpp b/search/search_integration_tests/smoke_test.cpp index 89f1bdec11..37df3584a2 100644 --- a/search/search_integration_tests/smoke_test.cpp +++ b/search/search_integration_tests/smoke_test.cpp @@ -242,13 +242,7 @@ UNIT_CLASS_TEST(SmokeTest, CategoriesTest) TestPOI poi(m2::PointD(1.0, 1.0), "poi", "en"); auto typeTokens = strings::Tokenize(classif().GetFullObjectName(type), "|"); - if (ftypes::IsRecyclingTypeChecker::Instance()(type)) - { - // recycling=XXX types are not drawable/visible alone. - poi.SetTypes({{"amenity", "recycling", "container"}, std::move(typeTokens)}); - } - else - poi.SetTypes({std::move(typeTokens)}); + poi.SetTypes({std::move(typeTokens)}); auto id = BuildMwm(countryName, DataHeader::MapType::Country, [&](TestMwmBuilder & builder) { builder.Add(poi); });