MCPcopy Create free account
hub / github.com/comaps/comaps / InitRanker

Method InitRanker

libs/search/processor.cpp:892–921  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

890} // namespace
891
892void 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
923void Processor::ClearCaches()
924{

Callers

nothing calls this directly

Calls 4

EraseIfFunction · 0.85
GetRegionInfoMethod · 0.80
IsCategorialRequestMethod · 0.80
InitMethod · 0.45

Tested by

no test coverage detected