diff options
author | vng <viktor.govako@gmail.com> | 2012-01-30 21:56:06 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:32:41 +0300 |
commit | 734df51bc1334176745a2a9e0099029505280c4d (patch) | |
tree | cbcb1c3a4a6a9b68c9873cb9d93e5712dd8f53cc /indexer/search_index_builder.cpp | |
parent | 187413d181b9e2de4b69867a732112ece1e908e9 (diff) |
[search] Reduce search rank for non-USA states.
Diffstat (limited to 'indexer/search_index_builder.cpp')
-rw-r--r-- | indexer/search_index_builder.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/indexer/search_index_builder.cpp b/indexer/search_index_builder.cpp index 3ece446110..2e40f3b9db 100644 --- a/indexer/search_index_builder.cpp +++ b/indexer/search_index_builder.cpp @@ -66,18 +66,18 @@ struct FeatureInserter explicit FeatureInserter(StringsFile & names) : m_names(names) {} - void operator() (FeatureType const & feature, uint64_t pos) const + void operator() (FeatureType const & f, uint64_t pos) const { - feature::TypesHolder types(feature); + feature::TypesHolder types(f); // Add names of the feature. - FeatureNameInserter f(m_names, static_cast<uint32_t>(pos), - feature::GetSearchRank(types, feature.GetPopulation())); - feature.ForEachNameRef(f); + uint8_t const rank = feature::GetSearchRank(types, f.GetLimitRect(-2).Center(), f.GetPopulation()); + FeatureNameInserter toDo(m_names, static_cast<uint32_t>(pos), rank); + f.ForEachNameRef(toDo); // Add names of categories of the feature. for (size_t i = 0; i < types.Size(); ++i) - f.AddToken(0, search::FeatureTypeToString(types[i])); + toDo.AddToken(0, search::FeatureTypeToString(types[i])); } }; |