From 1771b2ace63dd9b5bca534d53c1f886f5b6ce51c Mon Sep 17 00:00:00 2001 From: Viktor Govako Date: Mon, 21 Mar 2022 16:30:09 +0300 Subject: [PATCH] [search] Do not use "organic" type as preferred in Search UI. Signed-off-by: Viktor Govako --- search/processor.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/search/processor.cpp b/search/processor.cpp index 9cb756f963..b1eaa399ac 100644 --- a/search/processor.cpp +++ b/search/processor.cpp @@ -898,7 +898,16 @@ void Processor::InitRanker(Geocoder::Params const & geocoderParams, params.m_limit = searchParams.m_maxNumResults; params.m_pivot = m_position ? *m_position : GetViewport().Center(); params.m_pivotRegion = GetPivotRegion(); + params.m_preferredTypes = m_preferredTypes; + // Remove "secondary" category types from preferred. + base::EraseIf(params.m_preferredTypes, [](uint32_t type) + { + static uint32_t const organic = classif().GetTypeByPath({"organic"}); + ftype::TruncValue(type, 1); + return (organic == type); + }); + params.m_suggestsEnabled = searchParams.m_suggestsEnabled; params.m_needAddress = searchParams.m_needAddress; params.m_needHighlighting = searchParams.m_needHighlighting && !geocoderParams.IsCategorialRequest();