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-20 13:03:46 +0300
committerTatiana Yan <tatiana.kondakova@gmail.com>2019-02-20 20:49:23 +0300
commit73689767690e66912f7a4a0da4b70a3e6380e056 (patch)
treea59110b8a43d501e3e30fcb4c5f5619605e999ba /search
parent83516ca8fcd48d0f85d8d85233dc33313bb5e9e1 (diff)
[search] Added the original query to the debug output of QueryParams.
Diffstat (limited to 'search')
-rw-r--r--search/processor.cpp2
-rw-r--r--search/query_params.cpp4
-rw-r--r--search/query_params.hpp5
3 files changed, 10 insertions, 1 deletions
diff --git a/search/processor.cpp b/search/processor.cpp
index 61dc41fd6c..8e40472d5f 100644
--- a/search/processor.cpp
+++ b/search/processor.cpp
@@ -491,6 +491,8 @@ void Processor::SearchBookmarks() const
void Processor::InitParams(QueryParams & params) const
{
+ params.SetQuery(m_query);
+
if (m_prefix.empty())
params.InitNoPrefix(m_tokens.begin(), m_tokens.end());
else
diff --git a/search/query_params.cpp b/search/query_params.cpp
index 4a47444771..abbb857296 100644
--- a/search/query_params.cpp
+++ b/search/query_params.cpp
@@ -151,7 +151,9 @@ void QueryParams::AddSynonyms()
string DebugPrint(QueryParams const & params)
{
ostringstream os;
- os << "QueryParams [ m_tokens=" << ::DebugPrint(params.m_tokens)
+ os << "QueryParams [ "
+ << "m_query=\"" << params.m_query << "\""
+ << ", m_tokens=" << ::DebugPrint(params.m_tokens)
<< ", m_prefixToken=" << DebugPrint(params.m_prefixToken)
<< ", m_typeIndices=" << ::DebugPrint(params.m_typeIndices)
<< ", m_langs=" << DebugPrint(params.m_langs) << " ]";
diff --git a/search/query_params.hpp b/search/query_params.hpp
index 1a21f3660b..a96d814fb3 100644
--- a/search/query_params.hpp
+++ b/search/query_params.hpp
@@ -86,6 +86,8 @@ public:
QueryParams() = default;
+ void SetQuery(std::string const & query) { m_query = query; }
+
template <typename It>
void InitNoPrefix(It tokenBegin, It tokenEnd)
{
@@ -142,6 +144,9 @@ private:
void AddSynonyms();
+ // The original query without any normalizations.
+ std::string m_query;
+
std::vector<Token> m_tokens;
Token m_prefixToken;
bool m_hasPrefix = false;