Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortatiana-yan <tatiana.kondakova@gmail.com>2019-04-23 16:23:46 +0300
committermpimenov <mpimenov@users.noreply.github.com>2019-04-23 19:05:04 +0300
commitad0bca72b5f0adad982fffee1b5bf7e75d87f439 (patch)
tree869c9d372085f1c829e5746e52c6bcf522b94efd /search/pre_ranker.cpp
parente77592b68e345c8cec11324be0c03c1b5a8df6bb (diff)
[search] Heuristics for rating.
Diffstat (limited to 'search/pre_ranker.cpp')
-rw-r--r--search/pre_ranker.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/search/pre_ranker.cpp b/search/pre_ranker.cpp
index 711526d17c..5d6c16b309 100644
--- a/search/pre_ranker.cpp
+++ b/search/pre_ranker.cpp
@@ -5,6 +5,8 @@
#include "search/pre_ranking_info.hpp"
#include "search/tracer.hpp"
+#include "ugc/types.hpp"
+
#include "indexer/data_source.hpp"
#include "indexer/mwm_set.hpp"
#include "indexer/rank_table.hpp"
@@ -77,6 +79,7 @@ void PreRanker::FillMissingFieldsInPreResults()
MwmSet::MwmHandle mwmHandle;
unique_ptr<RankTable> ranks = make_unique<DummyRankTable>();
unique_ptr<RankTable> popularityRanks = make_unique<DummyRankTable>();
+ unique_ptr<RankTable> ratings = make_unique<DummyRankTable>();
unique_ptr<LazyCentersTable> centers;
bool pivotFeaturesInitialized = false;
@@ -94,16 +97,20 @@ void PreRanker::FillMissingFieldsInPreResults()
ranks = RankTable::Load(mwmHandle.GetValue<MwmValue>()->m_cont, SEARCH_RANKS_FILE_TAG);
popularityRanks = RankTable::Load(mwmHandle.GetValue<MwmValue>()->m_cont,
POPULARITY_RANKS_FILE_TAG);
+ ratings = RankTable::Load(mwmHandle.GetValue<MwmValue>()->m_cont, RATINGS_FILE_TAG);
centers = make_unique<LazyCentersTable>(*mwmHandle.GetValue<MwmValue>());
}
if (!ranks)
ranks = make_unique<DummyRankTable>();
if (!popularityRanks)
popularityRanks = make_unique<DummyRankTable>();
+ if (!ratings)
+ ratings = make_unique<DummyRankTable>();
}
info.m_rank = ranks->Get(id.m_index);
info.m_popularity = popularityRanks->Get(id.m_index);
+ info.m_rating = ugc::UGC::UnpackRating(ratings->Get(id.m_index));
m2::PointD center;
if (centers && centers->Get(id.m_index, center))