Review fixes.

This commit is contained in:
Yuri Gorshenin 2017-10-31 17:07:37 +03:00 committed by mpimenov
parent 6c26f7b97c
commit 44f92f69ce
7 changed files with 14 additions and 24 deletions

View file

@ -1348,7 +1348,7 @@ bool Framework::SearchEverywhere(search::EverywhereSearchParams const & params)
p.m_forceSearch = true;
p.m_suggestsEnabled = true;
p.m_needAddress = true;
p.m_needHighlight = true;
p.m_needHighlighting = true;
p.m_hotelsFilter = params.m_hotelsFilter;
p.m_cianMode = IsCianMode(params.m_query);
@ -1378,7 +1378,7 @@ bool Framework::SearchInViewport(search::ViewportSearchParams const & params)
p.m_forceSearch = false;
p.m_suggestsEnabled = false;
p.m_needAddress = false;
p.m_needHighlight = false;
p.m_needHighlighting = false;
p.m_hotelsFilter = params.m_hotelsFilter;
p.m_cianMode = m_cianSearchMode;
@ -1409,7 +1409,7 @@ bool Framework::SearchInDownloader(DownloaderSearchParams const & params)
p.m_forceSearch = true;
p.m_suggestsEnabled = false;
p.m_needAddress = false;
p.m_needHighlight = false;
p.m_needHighlighting = false;
p.m_onResults = search::DownloaderSearchCallback(
static_cast<search::DownloaderSearchCallback::Delegate &>(*this), m_model.GetIndex(),
GetCountryInfoGetter(), GetStorage(), params);

View file

@ -294,16 +294,6 @@ void Processor::SetQuery(string const & query)
});
}
void Processor::SetLanguage(int id, int8_t lang)
{
m_keywordsScorer.SetLanguage(GetLangIndex(id), lang);
}
int8_t Processor::GetLanguage(int id) const
{
return m_keywordsScorer.GetLanguage(GetLangIndex(id));
}
m2::PointD Processor::GetPivotPoint(bool viewportSearch) const
{
auto const & viewport = GetViewport();
@ -551,7 +541,7 @@ void Processor::InitRanker(Geocoder::Params const & geocoderParams,
params.m_preferredTypes = m_preferredTypes;
params.m_suggestsEnabled = searchParams.m_suggestsEnabled;
params.m_needAddress = searchParams.m_needAddress;
params.m_needHighlight = searchParams.m_needHighlight;
params.m_needHighlighting = searchParams.m_needHighlighting;
params.m_query = m_query;
params.m_tokens = m_tokens;
params.m_prefix = m_prefix;

View file

@ -113,8 +113,6 @@ protected:
m2::RectD m_viewport;
m2::PointD m_position;
bool m_needAddress = true;
bool m_needHighlight = true;
// Suggestions language code, not the same as we use in mwm data
int8_t m_inputLocaleCode = StringUtf8Multilang::kUnsupportedLanguageCode;

View file

@ -462,7 +462,7 @@ void Ranker::UpdateResults(bool lastUpdate)
if (count >= m_params.m_limit)
break;
Result result = MakeResult(rankerResult, m_params.m_needAddress, m_params.m_needHighlight);
Result result = MakeResult(rankerResult, m_params.m_needAddress, m_params.m_needHighlighting);
if (m_params.m_viewportSearch)
{

View file

@ -52,7 +52,7 @@ public:
set<uint32_t> m_preferredTypes;
bool m_suggestsEnabled = false;
bool m_needAddress = false;
bool m_needHighlight = false;
bool m_needHighlighting = false;
bool m_viewportSearch = false;
string m_query;

View file

@ -45,16 +45,18 @@ struct SearchParams
double m_minDistanceOnMapBetweenResults = 0.0;
Mode m_mode = Mode::Everywhere;
// When true, search request can't be skipped.
bool m_forceSearch = false;
// Is it needed to generate search suggests.
// Needed to generate search suggests.
bool m_suggestsEnabled = false;
// Is it needed to generate address for results.
// Needed to generate address for results.
bool m_needAddress = false;
// Is it needed to highlight matching parts of search result names.
bool m_needHighlight = false;
// Needed to highlight matching parts of search result names.
bool m_needHighlighting = false;
std::shared_ptr<hotels_filter::Rule> m_hotelsFilter;
bool m_cianMode = false;

View file

@ -88,13 +88,13 @@ void TestSearchRequest::SetUpResultParams()
case Mode::Everywhere:
m_params.m_needAddress = true;
m_params.m_suggestsEnabled = false;
m_params.m_needHighlight = true;
m_params.m_needHighlighting = true;
break;
case Mode::Viewport: // fallthrough
case Mode::Downloader:
m_params.m_needAddress = false;
m_params.m_suggestsEnabled = false;
m_params.m_needHighlight = false;
m_params.m_needHighlighting = false;
break;
case Mode::Count: CHECK(false, ()); break;
}