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:
authorvng <viktor.govako@gmail.com>2012-08-21 14:32:43 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:42:00 +0300
commit8c24fdf04016b109c3cf932fd5b663a54d432d40 (patch)
treed396f9b1daefc469308fac1bb22cd8c297cbe9cf /indexer/search_index_builder.cpp
parent73b11cd8d57388d167c6143301e8183e68b103de (diff)
[search] Fix scoring routine for matched keywords.
Diffstat (limited to 'indexer/search_index_builder.cpp')
-rw-r--r--indexer/search_index_builder.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/indexer/search_index_builder.cpp b/indexer/search_index_builder.cpp
index 204c2f075a..fe52cb5471 100644
--- a/indexer/search_index_builder.cpp
+++ b/indexer/search_index_builder.cpp
@@ -10,6 +10,8 @@
#include "feature_visibility.hpp"
#include "categories_holder.hpp"
+#include "../search/search_common.hpp" // for MAX_TOKENS constant
+
#include "../defines.hpp"
#include "../platform/platform.hpp"
@@ -47,11 +49,11 @@ struct FeatureNameInserter
buffer_vector<strings::UniString, 32> tokens;
SplitUniString(uniName, MakeBackInsertFunctor(tokens), search::Delimiters());
- /// @todo MAX_TOKENS = 32, in Query::Search we use 31 + prefix. Why 30 ???
- if (tokens.size() > 30)
+ int const maxTokensCount = search::MAX_TOKENS - 1;
+ if (tokens.size() > maxTokensCount)
{
LOG(LWARNING, ("Name has too many tokens:", name));
- tokens.resize(30);
+ tokens.resize(maxTokensCount);
}
for (size_t i = 0; i < tokens.size(); ++i)