| 890 | } // namespace |
| 891 | |
| 892 | void Processor::InitRanker(Geocoder::Params const & geocoderParams, SearchParams const & searchParams) |
| 893 | { |
| 894 | bool const viewportSearch = searchParams.m_mode == Mode::Viewport; |
| 895 | |
| 896 | Ranker::Params params; |
| 897 | |
| 898 | params.m_batchSize = searchParams.m_batchSize; |
| 899 | params.m_limit = searchParams.m_maxNumResults; |
| 900 | params.m_pivot = GetPivotPoint(viewportSearch); |
| 901 | { |
| 902 | storage::CountryInfo info; |
| 903 | m_infoGetter.GetRegionInfo(params.m_pivot, info); |
| 904 | params.m_pivotRegion = std::move(info.m_name); |
| 905 | } |
| 906 | |
| 907 | params.m_preferredTypes = m_preferredTypes; |
| 908 | // Remove "secondary" category types from preferred. |
| 909 | base::EraseIf(params.m_preferredTypes, NotInPreffered::Instance()); |
| 910 | |
| 911 | params.m_suggestsEnabled = searchParams.m_suggestsEnabled; |
| 912 | params.m_needAddress = searchParams.m_needAddress; |
| 913 | params.m_needHighlighting = searchParams.m_needHighlighting && !geocoderParams.IsCategorialRequest(); |
| 914 | params.m_query = m_query; |
| 915 | params.m_categoryLocales = GetCategoryLocales(); |
| 916 | params.m_viewportSearch = viewportSearch; |
| 917 | params.m_viewport = GetViewport(); |
| 918 | params.m_categorialRequest = geocoderParams.IsCategorialRequest(); |
| 919 | |
| 920 | m_ranker.Init(params, geocoderParams); |
| 921 | } |
| 922 | |
| 923 | void Processor::ClearCaches() |
| 924 | { |
nothing calls this directly
no test coverage detected