diff options
author | Yury Melnichek <melnichek@gmail.com> | 2012-01-25 22:11:47 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:32:25 +0300 |
commit | 75c45c2f4cbb89ae7c7431492acf1867e5e6669b (patch) | |
tree | 7f3380a021dbe7fd560c912c6b292f997f81c17d /indexer/search_index_builder.cpp | |
parent | d8ed2e335be684bd1da8a8fc6fe5050e5220d0fa (diff) |
[search] Do not store ranks in the search index.
Diffstat (limited to 'indexer/search_index_builder.cpp')
-rw-r--r-- | indexer/search_index_builder.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/indexer/search_index_builder.cpp b/indexer/search_index_builder.cpp index 49fa79f317..c3800a5ac8 100644 --- a/indexer/search_index_builder.cpp +++ b/indexer/search_index_builder.cpp @@ -39,9 +39,9 @@ struct FeatureNameInserter AddToken(lang, s, m_rank); } - void AddToken(signed char lang, strings::UniString const & s, uint32_t rank) const + void AddToken(signed char lang, strings::UniString const & s, uint32_t /*rank*/) const { - m_names.AddString(StringsFile::StringT(s, lang, m_pos, static_cast<uint8_t>(min(rank, 255U)))); + m_names.AddString(StringsFile::StringT(s, lang, m_pos)); } bool operator()(signed char lang, string const & name) const @@ -80,17 +80,6 @@ struct FeatureInserter } }; -struct MaxValueCalc -{ - typedef uint8_t ValueType; - - ValueType operator() (void const * p, uint32_t size) const - { - ASSERT_EQUAL(size, 5, ()); - return *static_cast<uint8_t const *>(p); - } -}; - } // unnamed namespace void indexer::BuildSearchIndex(FeaturesVector const & featuresVector, Writer & writer, @@ -103,8 +92,7 @@ void indexer::BuildSearchIndex(FeaturesVector const & featuresVector, Writer & w names.EndAdding(); names.OpenForRead(); - trie::Build(writer, names.Begin(), names.End(), - trie::builder::MaxValueEdgeBuilder<MaxValueCalc>()); + trie::Build(writer, names.Begin(), names.End(), trie::builder::EmptyEdgeBuilder()); // at this point all readers should be dead } |