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
path: root/search
diff options
context:
space:
mode:
authorMaxim Pimenov <m@maps.me>2019-02-19 15:53:29 +0300
committerTatiana Yan <tatiana.kondakova@gmail.com>2019-02-20 20:49:23 +0300
commit83516ca8fcd48d0f85d8d85233dc33313bb5e9e1 (patch)
tree423e3d4146506f354110ae82606cda39f6f0f93b /search
parent6e830e8ac5a3f9b35d4c63eb7384d948f019ab3c (diff)
Review fixes.
Diffstat (limited to 'search')
-rw-r--r--search/intermediate_result.cpp6
-rw-r--r--search/intermediate_result.hpp2
-rw-r--r--search/pre_ranker.cpp1
-rw-r--r--search/ranker.cpp2
-rw-r--r--search/ranking_info.cpp22
-rw-r--r--search/result.cpp6
-rw-r--r--search/search_integration_tests/pre_ranker_test.cpp3
-rw-r--r--search/search_integration_tests/processor_test.cpp5
8 files changed, 18 insertions, 29 deletions
diff --git a/search/intermediate_result.cpp b/search/intermediate_result.cpp
index 563b3f03a9..33e756b066 100644
--- a/search/intermediate_result.cpp
+++ b/search/intermediate_result.cpp
@@ -66,12 +66,6 @@ public:
} // namespace
// PreRankerResult ---------------------------------------------------------------------------------
-PreRankerResult::PreRankerResult(FeatureID const & id, PreRankingInfo const & info)
- : m_id(id), m_info(info)
-{
- ASSERT(m_id.IsValid(), ());
-}
-
PreRankerResult::PreRankerResult(FeatureID const & id, PreRankingInfo const & info,
vector<ResultTracer::Branch> const & provenance)
: m_id(id), m_info(info), m_provenance(provenance)
diff --git a/search/intermediate_result.hpp b/search/intermediate_result.hpp
index 6b0058e258..b2a1b848a4 100644
--- a/search/intermediate_result.hpp
+++ b/search/intermediate_result.hpp
@@ -32,8 +32,6 @@ class ReverseGeocoder;
class PreRankerResult
{
public:
- PreRankerResult(FeatureID const & id, PreRankingInfo const & info);
-
PreRankerResult(FeatureID const & id, PreRankingInfo const & info,
std::vector<ResultTracer::Branch> const & provenance);
diff --git a/search/pre_ranker.cpp b/search/pre_ranker.cpp
index d4c20193c3..cea49b9ac7 100644
--- a/search/pre_ranker.cpp
+++ b/search/pre_ranker.cpp
@@ -228,7 +228,6 @@ void PreRanker::UpdateResults(bool lastUpdate)
FilterRelaxedResults(lastUpdate);
FillMissingFieldsInPreResults();
Filter(m_params.m_viewportSearch);
- LOG(LINFO, ("sending", m_results.size(), "results to ranker"));
m_numSentResults += m_results.size();
m_ranker.SetPreRankerResults(move(m_results));
m_results.clear();
diff --git a/search/ranker.cpp b/search/ranker.cpp
index 1fc6981a42..0fd446290d 100644
--- a/search/ranker.cpp
+++ b/search/ranker.cpp
@@ -516,9 +516,7 @@ void Ranker::UpdateResults(bool lastUpdate)
BailIfCancelled();
MakeRankerResults(m_geocoderParams, m_tentativeResults);
- LOG(LINFO, ("made res, size =", m_tentativeResults.size()));
RemoveDuplicatingLinear(m_tentativeResults);
- LOG(LINFO, ("removed duplicates, size =", m_tentativeResults.size()));
if (m_tentativeResults.empty())
return;
diff --git a/search/ranking_info.cpp b/search/ranking_info.cpp
index 5e37a69c5e..fdb4f675aa 100644
--- a/search/ranking_info.cpp
+++ b/search/ranking_info.cpp
@@ -72,17 +72,17 @@ string DebugPrint(RankingInfo const & info)
ostringstream os;
os << boolalpha;
os << "RankingInfo [";
- os << "m_distanceToPivot:" << info.m_distanceToPivot << ",";
- os << "m_rank:" << static_cast<int>(info.m_rank) << ",";
- os << "m_popularity:" << static_cast<int>(info.m_popularity) << ",";
- os << "m_nameScore:" << DebugPrint(info.m_nameScore) << ",";
- os << "m_errorsMade:" << DebugPrint(info.m_errorsMade) << ",";
- os << "m_type:" << DebugPrint(info.m_type) << ",";
- os << "m_pureCats:" << info.m_pureCats << ",";
- os << "m_falseCats:" << info.m_falseCats << ",";
- os << "m_allTokensUsed:" << info.m_allTokensUsed << ",";
- os << "m_categorialRequest:" << info.m_categorialRequest << ",";
- os << "m_hasName:" << info.m_hasName;
+ os << "m_distanceToPivot:" << info.m_distanceToPivot;
+ os << ", m_rank:" << static_cast<int>(info.m_rank);
+ os << ", m_popularity:" << static_cast<int>(info.m_popularity);
+ os << ", m_nameScore:" << DebugPrint(info.m_nameScore);
+ os << ", m_errorsMade:" << DebugPrint(info.m_errorsMade);
+ os << ", m_type:" << DebugPrint(info.m_type);
+ os << ", m_pureCats:" << info.m_pureCats;
+ os << ", m_falseCats:" << info.m_falseCats;
+ os << ", m_allTokensUsed:" << info.m_allTokensUsed;
+ os << ", m_categorialRequest:" << info.m_categorialRequest;
+ os << ", m_hasName:" << info.m_hasName;
os << "]";
return os.str();
}
diff --git a/search/result.cpp b/search/result.cpp
index 6083a9586a..f7a0123af5 100644
--- a/search/result.cpp
+++ b/search/result.cpp
@@ -164,9 +164,9 @@ string DebugPrint(Result const & result)
ostringstream os;
os << "Result [";
- os << "name: " << result.GetString() << ", ";
- os << "type: " << readableType << ", ";
- os << "info: " << DebugPrint(result.GetRankingInfo());
+ os << "name: " << result.GetString();
+ os << ", type: " << readableType;
+ os << ", info: " << DebugPrint(result.GetRankingInfo());
if (!result.GetProvenance().empty())
os << ", provenance: " << ::DebugPrint(result.GetProvenance());
os << "]";
diff --git a/search/search_integration_tests/pre_ranker_test.cpp b/search/search_integration_tests/pre_ranker_test.cpp
index c978463178..69be669a6d 100644
--- a/search/search_integration_tests/pre_ranker_test.cpp
+++ b/search/search_integration_tests/pre_ranker_test.cpp
@@ -147,7 +147,8 @@ UNIT_CLASS_TEST(PreRankerTest, Smoke)
FeaturesVectorTest fv(mwmId.GetInfo()->GetLocalFile().GetPath(MapOptions::Map));
fv.GetVector().ForEach([&](FeatureType & ft, uint32_t index) {
FeatureID id(mwmId, index);
- preRanker.Emplace(id, PreRankingInfo(Model::TYPE_POI, TokenRange(0, 1)));
+ ResultTracer::Provenance provenance;
+ preRanker.Emplace(id, PreRankingInfo(Model::TYPE_POI, TokenRange(0, 1)), provenance);
TEST_LESS(index, pois.size(), ());
distances[index] = MercatorBounds::DistanceOnEarth(feature::GetCenter(ft), kPivot);
diff --git a/search/search_integration_tests/processor_test.cpp b/search/search_integration_tests/processor_test.cpp
index bdb5cbb8f3..a7010f8088 100644
--- a/search/search_integration_tests/processor_test.cpp
+++ b/search/search_integration_tests/processor_test.cpp
@@ -293,7 +293,7 @@ UNIT_CLASS_TEST(ProcessorTest, Smoke)
TEST(ResultsMatch("bohr street 1", rules), ());
}
{
- TEST(ResultsMatch("bohr street 1 unit 3", {ExactMatch(wonderlandId, bohrStreet1)}), ());
+ TEST(ResultsMatch("bohr street 1 unit 3", {ExactMatch(wonderlandId, bohrStreet1)}), ());
}
{
Rules rules = {ExactMatch(wonderlandId, lantern1), ExactMatch(wonderlandId, lantern2)};
@@ -1761,8 +1761,7 @@ UNIT_CLASS_TEST(ProcessorTest, SynonymsTest)
}
{
Rules rules = {ExactMatch(wonderlandId, stPeterRu)};
- Rules relaxedRules = {ExactMatch(wonderlandId, stPeterRu),
- ExactMatch(wonderlandId, streetRu)};
+ Rules relaxedRules = {ExactMatch(wonderlandId, stPeterRu), ExactMatch(wonderlandId, streetRu)};
TEST(ResultsMatch("собор святого петра ", rules), ());
TEST(ResultsMatch("собор св петра ", relaxedRules), ());
}