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:
-rw-r--r--generator/dumper.cpp3
-rw-r--r--indexer/search_index_builder.cpp7
-rw-r--r--indexer/search_trie.hpp7
-rw-r--r--search/search_query.cpp3
4 files changed, 12 insertions, 8 deletions
diff --git a/generator/dumper.cpp b/generator/dumper.cpp
index d03fb66254..8053344fa6 100644
--- a/generator/dumper.cpp
+++ b/generator/dumper.cpp
@@ -202,8 +202,7 @@ namespace feature
feature::DataHeader header;
header.Load(container.GetReader(HEADER_FILE_TAG));
- serial::CodingParams cp(search::POINT_CODING_BITS,
- header.GetDefCodingParams().GetBasePointUint64());
+ serial::CodingParams cp(search::GetCPForTrie(header.GetDefCodingParams()));
scoped_ptr<search::TrieIterator> pTrieRoot(
::trie::reader::ReadTrie(container.GetReader(SEARCH_INDEX_FILE_TAG),
diff --git a/indexer/search_index_builder.cpp b/indexer/search_index_builder.cpp
index 5d47d063ff..2b20e112cb 100644
--- a/indexer/search_index_builder.cpp
+++ b/indexer/search_index_builder.cpp
@@ -164,8 +164,7 @@ void indexer::BuildSearchIndex(FeaturesVector const & featuresVector, Writer & w
{
{
StringsFile names(tmpFilePath);
- serial::CodingParams cp(search::POINT_CODING_BITS,
- featuresVector.GetCodingParams().GetBasePointUint64());
+ serial::CodingParams cp(search::GetCPForTrie(featuresVector.GetCodingParams()));
featuresVector.ForEachOffset(FeatureInserter(names, cp));
@@ -182,7 +181,7 @@ void indexer::BuildSearchIndex(FeaturesVector const & featuresVector, Writer & w
bool indexer::BuildSearchIndexFromDatFile(string const & fName)
{
- LOG(LINFO, ("Start building search index ..."));
+ LOG(LINFO, ("Start building search index. Bits = ", search::POINT_CODING_BITS));
try
{
@@ -200,6 +199,8 @@ bool indexer::BuildSearchIndexFromDatFile(string const & fName)
FileWriter writer(tmpFile);
BuildSearchIndex(featuresVector, writer, pl.WritablePathForFile(fName + ".search_index_1.tmp"));
+
+ LOG(LINFO, ("Search index size = ", writer.Size()));
}
{
diff --git a/indexer/search_trie.hpp b/indexer/search_trie.hpp
index cd899f19ed..f44d8b5166 100644
--- a/indexer/search_trie.hpp
+++ b/indexer/search_trie.hpp
@@ -51,6 +51,11 @@ typedef ::trie::reader::EmptyValueReader EdgeValueReader;
trie::EdgeValueReader::ValueType> TrieIterator;
static const uint8_t CATEGORIES_LANG = 128;
- static const uint8_t POINT_CODING_BITS = 24;
+ static const uint8_t POINT_CODING_BITS = 20;
+ inline serial::CodingParams GetCPForTrie(serial::CodingParams const & orig)
+ {
+ CoordPointT const p = PointU2PointD(orig.GetBasePoint(), orig.GetCoordBits());
+ return serial::CodingParams(POINT_CODING_BITS, m2::PointD(p.first, p.second));
+ }
} // namespace search
diff --git a/search/search_query.cpp b/search/search_query.cpp
index bd6049a009..9d8b0fba1f 100644
--- a/search/search_query.cpp
+++ b/search/search_query.cpp
@@ -629,8 +629,7 @@ void Query::SearchFeatures(vector<vector<strings::UniString> > const & tokens,
if (pMwm->m_cont.IsReaderExist(SEARCH_INDEX_FILE_TAG))
{
feature::DataHeader const & header = pMwm->GetHeader();
- serial::CodingParams cp(POINT_CODING_BITS,
- header.GetDefCodingParams().GetBasePointUint64());
+ serial::CodingParams cp(GetCPForTrie(header.GetDefCodingParams()));
scoped_ptr<TrieIterator> pTrieRoot(::trie::reader::ReadTrie(
pMwm->m_cont.GetReader(SEARCH_INDEX_FILE_TAG),