diff --git a/base/string_utils.hpp b/base/string_utils.hpp index 1b2f308de0..ecdc5d5d79 100644 --- a/base/string_utils.hpp +++ b/base/string_utils.hpp @@ -18,17 +18,20 @@ /// All methods work with strings in utf-8 format namespace strings { -typedef uint32_t UniChar; +using UniChar = uint32_t; // typedef buffer_vector UniString; /// Make new type, not typedef. Need to specialize DebugPrint. class UniString : public buffer_vector { - typedef buffer_vector BaseT; + using BaseT = buffer_vector; public: + using value_type = UniChar; + UniString() {} explicit UniString(size_t n, UniChar c = UniChar()) : BaseT(n, c) {} + template UniString(IterT b, IterT e) : BaseT(b, e) diff --git a/indexer/search_string_utils.hpp b/indexer/search_string_utils.hpp index b127530ba3..22c049d517 100644 --- a/indexer/search_string_utils.hpp +++ b/indexer/search_string_utils.hpp @@ -18,7 +18,7 @@ namespace search strings::UniString NormalizeAndSimplifyString(std::string const & s); template -void SplitUniString(strings::UniString const & uniS, Fn f, Delims const & delims) +void SplitUniString(strings::UniString const & uniS, Fn && f, Delims const & delims) { for (strings::TokenizeIterator iter(uniS, delims); iter; ++iter) f(iter.GetUniString()); diff --git a/search/base/text_index.hpp b/search/base/text_index.hpp index 833c403b08..aa22a104b1 100644 --- a/search/base/text_index.hpp +++ b/search/base/text_index.hpp @@ -77,6 +77,7 @@ struct TextIndexHeader source.Read(&headerMagic[0], headerMagic.size()); CHECK_EQUAL(headerMagic, kHeaderMagic, ()); m_version = static_cast(ReadPrimitiveFromSource(source)); + CHECK_EQUAL(m_version, TextIndexVersion::V0, ()); m_numTokens = ReadPrimitiveFromSource(source); m_dictPositionsOffset = ReadPrimitiveFromSource(source); m_dictWordsOffset = ReadPrimitiveFromSource(source); @@ -109,10 +110,10 @@ public: template void ForEachPosting(Token const & token, F && f) const { - auto it = m_postingsByToken.find(token); + auto const it = m_postingsByToken.find(token); if (it == m_postingsByToken.end()) return; - for (auto const & p : it->second) + for (auto const p : it->second) f(p); } @@ -124,31 +125,117 @@ public: TextIndexHeader header; uint64_t const startPos = sink.Pos(); + // Will be filled in later. header.Serialize(sink); header.m_numTokens = ::base::checked_cast(m_postingsByToken.size()); + SerializeDictionary(sink, header, startPos); + SerializePostingsLists(sink, header, startPos); + uint64_t const finishPos = sink.Pos(); + sink.Seek(startPos); + header.Serialize(sink); + sink.Seek(finishPos); + } + + template + void Deserialize(Source & source) + { + uint64_t startPos = source.Pos(); + + TextIndexHeader header; + header.Deserialize(source); + + std::vector tokens; + DeserializeDictionary(source, header, startPos, tokens); + DeserializePostingsLists(source, header, startPos, tokens); + } + +private: + template + void SerializeDictionary(Sink & sink, TextIndexHeader & header, uint64_t startPos) const + { header.m_dictPositionsOffset = RelativePos(sink, startPos); - uint32_t offset = header.m_dictPositionsOffset; - for (auto const & entry : m_postingsByToken) - { - auto const & token = entry.first; - WriteToSink(sink, offset); - offset += static_cast(token.size()); - } - // One more for convenience. - WriteToSink(sink, offset); - + // An uint32_t for each 32-bit offset and an uint32_t for the dummy entry at the end. + WriteZeroesToSink(sink, sizeof(uint32_t) * (header.m_numTokens + 1)); header.m_dictWordsOffset = RelativePos(sink, startPos); + + std::vector offsets; + offsets.reserve(header.m_numTokens + 1); + for (auto const & entry : m_postingsByToken) { - auto const & token = entry.first; - sink.Write(token.data(), token.size()); + offsets.emplace_back(RelativePos(sink, startPos)); + SerializeToken(sink, entry.first); } + offsets.emplace_back(RelativePos(sink, startPos)); + { + uint64_t const savedPos = sink.Pos(); + sink.Seek(startPos + header.m_dictPositionsOffset); + + for (uint32_t const o : offsets) + WriteToSink(sink, o); + + CHECK_EQUAL(sink.Pos(), startPos + header.m_dictWordsOffset, ()); + sink.Seek(savedPos); + } + } + + template + static void DeserializeDictionary(Source & source, TextIndexHeader const & header, + uint64_t startPos, std::vector & tokens) + { + CHECK_EQUAL(source.Pos(), startPos + header.m_dictPositionsOffset, ()); + std::vector tokenOffsets(header.m_numTokens + 1); + for (uint32_t & offset : tokenOffsets) + offset = ReadPrimitiveFromSource(source); + + CHECK_EQUAL(source.Pos(), startPos + header.m_dictWordsOffset, ()); + tokens.resize(header.m_numTokens); + for (size_t i = 0; i < tokens.size(); ++i) + { + size_t const size = ::base::checked_cast(tokenOffsets[i + 1] - tokenOffsets[i]); + DeserializeToken(source, tokens[i], size); + } + } + + template + static void SerializeToken(Sink & sink, std::string const & token) + { + CHECK(!token.empty(), ()); + sink.Write(token.data(), token.size()); + } + + template + static void SerializeToken(Sink & sink, strings::UniString const & token) + { + CHECK(!token.empty(), ()); + // todo(@m) Endianness. + sink.Write(token.data(), token.size() * sizeof(strings::UniString::value_type)); + } + + template + static void DeserializeToken(Source & source, std::string & token, size_t size) + { + token.resize(size); + source.Read(&token[0], size); + } + + template + static void DeserializeToken(Source & source, strings::UniString & token, size_t size) + { + ASSERT_EQUAL(size % sizeof(strings::UniString::value_type), 0, ()); + token.resize(size / sizeof(strings::UniString::value_type)); + source.Read(&token[0], size); + } + + template + void SerializePostingsLists(Sink & sink, TextIndexHeader & header, uint64_t startPos) const + { header.m_postingsStartsOffset = RelativePos(sink, startPos); - // 4 bytes for each 32-bit position and 4 bytes for the dummy entry at the end. - WriteZeroesToSink(sink, 4 * (header.m_numTokens + 1)); + // An uint32_t for each 32-bit offset and an uint32_t for the dummy entry at the end. + WriteZeroesToSink(sink, sizeof(uint32_t) * (header.m_numTokens + 1)); header.m_postingsListsOffset = RelativePos(sink, startPos); @@ -160,11 +247,11 @@ public: postingsStarts.emplace_back(RelativePos(sink, startPos)); - uint64_t last = 0; - for (auto const & p : postings) + uint32_t last = 0; + for (auto const p : postings) { CHECK(last == 0 || last < p, (last, p)); - uint64_t const delta = ::base::checked_cast(p) - last; + uint32_t const delta = p - last; WriteVarUint(sink, delta); last = p; } @@ -181,35 +268,12 @@ public: CHECK_EQUAL(sink.Pos(), startPos + header.m_postingsListsOffset, ()); sink.Seek(savedPos); } - - uint64_t const finishPos = sink.Pos(); - sink.Seek(startPos); - header.Serialize(sink); - sink.Seek(finishPos); } template - void Deserialize(Source & source) + void DeserializePostingsLists(Source & source, TextIndexHeader const & header, uint64_t startPos, + std::vector const & tokens) { - uint64_t startPos = source.Pos(); - - TextIndexHeader header; - header.Deserialize(source); - - CHECK_EQUAL(source.Pos(), startPos + header.m_dictPositionsOffset, ()); - std::vector tokenOffsets(header.m_numTokens + 1); - for (size_t i = 0; i < tokenOffsets.size(); ++i) - tokenOffsets[i] = ReadPrimitiveFromSource(source); - - CHECK_EQUAL(source.Pos(), startPos + header.m_dictWordsOffset, ()); - std::vector tokens(header.m_numTokens); - for (size_t i = 0; i < tokens.size(); ++i) - { - size_t const size = ::base::checked_cast(tokenOffsets[i + 1] - tokenOffsets[i]); - tokens[i].resize(size); - source.Read(&tokens[i][0], size); - } - CHECK_EQUAL(source.Pos(), startPos + header.m_postingsStartsOffset, ()); std::vector postingsStarts(header.m_numTokens + 1); for (size_t i = 0; i < postingsStarts.size(); ++i) @@ -232,7 +296,6 @@ public: } } -private: void SortPostings() { for (auto & entry : m_postingsByToken) @@ -246,7 +309,7 @@ private: } template - uint32_t RelativePos(Sink & sink, uint64_t startPos) + static uint32_t RelativePos(Sink & sink, uint64_t startPos) { return ::base::checked_cast(sink.Pos() - startPos); } diff --git a/search/search_tests/text_index_tests.cpp b/search/search_tests/text_index_tests.cpp index 342960205e..5003ea1880 100644 --- a/search/search_tests/text_index_tests.cpp +++ b/search/search_tests/text_index_tests.cpp @@ -2,6 +2,8 @@ #include "search/base/text_index.hpp" +#include "indexer/search_string_utils.hpp" + #include "coding/reader.hpp" #include "coding/write_to_sink.hpp" #include "coding/writer.hpp" @@ -9,18 +11,59 @@ #include "base/stl_add.hpp" #include "base/string_utils.hpp" +#include "std/transform_iterator.hpp" + +#include +#include +#include + using namespace search::base; using namespace search; using namespace std; +namespace +{ +template +void Serdes(MemTextIndex & memIndex, MemTextIndex & deserializedMemIndex) +{ + // Prepend several bytes to check the relative offsets. + size_t const kSkip = 10; + vector buf; + { + MemWriter writer(buf); + WriteZeroesToSink(writer, kSkip); + memIndex.Serialize(writer); + } + + { + MemReaderWithExceptions reader(buf.data() + kSkip, buf.size()); + ReaderSource source(reader); + deserializedMemIndex.Deserialize(source); + } +} + +template +void TestForEach(MemTextIndex const & index, Token const & token, + vector const & expected) +{ + vector actual; + index.ForEachPosting(token, MakeBackInsertFunctor(actual)); + TEST_EQUAL(actual, expected, ()); +}; +} // namespace + +namespace search +{ UNIT_TEST(MemTextIndex_Smoke) { - vector const docsCollection = { + using Token = string; + + vector const docsCollection = { "a b c", "a c", }; - MemTextIndex memIndex; + MemTextIndex memIndex; for (size_t docId = 0; docId < docsCollection.size(); ++docId) { @@ -32,32 +75,49 @@ UNIT_TEST(MemTextIndex_Smoke) } } - // Prepend several bytes to check the relative offsets. - size_t const kSkip = 10; - vector buf; + MemTextIndex deserializedMemIndex; + Serdes(memIndex, deserializedMemIndex); + + for (auto const & index : {memIndex, deserializedMemIndex}) { - MemWriter writer(buf); - WriteZeroesToSink(writer, kSkip); - memIndex.Serialize(writer); + TestForEach(index, "a", {0, 1}); + TestForEach(index, "b", {0}); + TestForEach(index, "c", {0, 1}); } - - MemTextIndex deserializedMemIndex; - { - MemReaderWithExceptions reader(buf.data() + kSkip, buf.size()); - ReaderSource source(reader); - deserializedMemIndex.Deserialize(source); - } - - auto testForEach = [&](string const & token, vector const & expected) { - for (auto const & idx : {memIndex, deserializedMemIndex}) - { - vector actual; - idx.ForEachPosting(token, MakeBackInsertFunctor(actual)); - TEST_EQUAL(actual, expected, ()); - } - }; - - testForEach("a", {0, 1}); - testForEach("b", {0}); - testForEach("c", {0, 1}); } + +UNIT_TEST(MemTextIndex_UniString) +{ + using Token = strings::UniString; + + vector const docsCollectionUtf8s = { + "â b ç", + "â ç", + }; + vector const docsCollection( + make_transform_iterator(docsCollectionUtf8s.begin(), &strings::MakeUniString), + make_transform_iterator(docsCollectionUtf8s.end(), &strings::MakeUniString)); + + MemTextIndex memIndex; + + for (size_t docId = 0; docId < docsCollection.size(); ++docId) + { + auto addToIndex = [&](Token const & token) { + memIndex.AddPosting(token, static_cast(docId)); + }; + auto delims = [](strings::UniChar const & c) { return c == ' '; }; + SplitUniString(docsCollection[docId], addToIndex, delims); + } + + MemTextIndex deserializedMemIndex; + Serdes(memIndex, deserializedMemIndex); + + for (auto const & index : {memIndex, deserializedMemIndex}) + { + TestForEach(index, strings::MakeUniString("a"), {}); + TestForEach(index, strings::MakeUniString("â"), {0, 1}); + TestForEach(index, strings::MakeUniString("b"), {0}); + TestForEach(index, strings::MakeUniString("ç"), {0, 1}); + } +} +} // namespace search diff --git a/xcode/search/search.xcodeproj/project.pbxproj b/xcode/search/search.xcodeproj/project.pbxproj index d731e30888..afe3a66f81 100644 --- a/xcode/search/search.xcodeproj/project.pbxproj +++ b/xcode/search/search.xcodeproj/project.pbxproj @@ -28,12 +28,6 @@ 3453BD591DAF91C100380ECB /* emitter.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3453BD561DAF91C100380ECB /* emitter.hpp */; }; 3453BD5A1DAF91C100380ECB /* hotels_filter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3453BD571DAF91C100380ECB /* hotels_filter.cpp */; }; 3453BD5B1DAF91C100380ECB /* hotels_filter.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3453BD581DAF91C100380ECB /* hotels_filter.hpp */; }; - 34586B891DCB1E8300CF7FC9 /* hotels_filter_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B821DCB1E8300CF7FC9 /* hotels_filter_test.cpp */; }; - 34586B8A1DCB1E8300CF7FC9 /* house_numbers_matcher_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B831DCB1E8300CF7FC9 /* house_numbers_matcher_test.cpp */; }; - 34586B8B1DCB1E8300CF7FC9 /* interval_set_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B841DCB1E8300CF7FC9 /* interval_set_test.cpp */; }; - 34586B8C1DCB1E8300CF7FC9 /* locality_scorer_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B851DCB1E8300CF7FC9 /* locality_scorer_test.cpp */; }; - 34586B8D1DCB1E8300CF7FC9 /* locality_selector_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B861DCB1E8300CF7FC9 /* locality_selector_test.cpp */; }; - 34586B8F1DCB1E8300CF7FC9 /* ranking_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B881DCB1E8300CF7FC9 /* ranking_tests.cpp */; }; 3459A7A71E4C4D0200ED235F /* geocoder_locality.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3459A7A51E4C4D0200ED235F /* geocoder_locality.cpp */; }; 3459A7A81E4C4D0200ED235F /* geocoder_locality.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3459A7A61E4C4D0200ED235F /* geocoder_locality.hpp */; }; 345C8DAF1D2D15A50037E3A6 /* cbv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 345C8DA91D2D15A50037E3A6 /* cbv.cpp */; }; @@ -76,14 +70,22 @@ 34F558471DBF2E8100A4FC11 /* libsuccinct.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 34F558461DBF2E8100A4FC11 /* libsuccinct.a */; }; 34F558491DBF2EC700A4FC11 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 34F558481DBF2EC700A4FC11 /* libz.tbd */; }; 3913DA511F9FCC88004AA681 /* suggest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3913DA501F9FCC88004AA681 /* suggest.cpp */; }; - 3974BB881FB471AB00F265E5 /* highlighting_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39BBC1411F9FD68C009D1687 /* highlighting_tests.cpp */; }; - 3974BB891FB471AB00F265E5 /* point_rect_matcher_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39BBC13F1F9FD683009D1687 /* point_rect_matcher_tests.cpp */; }; - 3974BB8A1FB471AB00F265E5 /* segment_tree_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39BBC13D1F9FD679009D1687 /* segment_tree_tests.cpp */; }; - 3974BB8B1FB471AB00F265E5 /* hotels_filter_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B821DCB1E8300CF7FC9 /* hotels_filter_test.cpp */; }; - 3974BB8C1FB471AB00F265E5 /* house_numbers_matcher_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B831DCB1E8300CF7FC9 /* house_numbers_matcher_test.cpp */; }; - 3974BB8D1FB471AB00F265E5 /* interval_set_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B841DCB1E8300CF7FC9 /* interval_set_test.cpp */; }; - 3974BB8E1FB471AB00F265E5 /* locality_scorer_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B851DCB1E8300CF7FC9 /* locality_scorer_test.cpp */; }; - 3974BB8F1FB471AB00F265E5 /* locality_selector_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B861DCB1E8300CF7FC9 /* locality_selector_test.cpp */; }; + 3925B85620B2FB1B00CEFE4D /* libstorage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3925B85520B2FB1B00CEFE4D /* libstorage.a */; }; + 392688B220B2D19000721762 /* text_index.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 392688B020B2D19000721762 /* text_index.cpp */; }; + 392688B320B2D19000721762 /* text_index.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 392688B120B2D19000721762 /* text_index.hpp */; }; + 392688C320B2D1D600721762 /* bookmarks_processor_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 392688B420B2D1BF00721762 /* bookmarks_processor_tests.cpp */; }; + 392688C420B2D1D600721762 /* mem_search_index_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 392688B520B2D1BF00721762 /* mem_search_index_tests.cpp */; }; + 392688C520B2D1D600721762 /* region_info_getter_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 392688B720B2D1BF00721762 /* region_info_getter_tests.cpp */; }; + 392688C620B2D1D600721762 /* results_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 392688B620B2D1BF00721762 /* results_tests.cpp */; }; + 392688C720B2D1D600721762 /* text_index_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 392688B820B2D1BF00721762 /* text_index_tests.cpp */; }; + 392688C820B2D1D600721762 /* highlighting_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39BBC1411F9FD68C009D1687 /* highlighting_tests.cpp */; }; + 392688C920B2D1D600721762 /* point_rect_matcher_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39BBC13F1F9FD683009D1687 /* point_rect_matcher_tests.cpp */; }; + 392688CA20B2D1D600721762 /* segment_tree_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39BBC13D1F9FD679009D1687 /* segment_tree_tests.cpp */; }; + 392688CB20B2D1D600721762 /* hotels_filter_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B821DCB1E8300CF7FC9 /* hotels_filter_test.cpp */; }; + 392688CC20B2D1D600721762 /* house_numbers_matcher_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B831DCB1E8300CF7FC9 /* house_numbers_matcher_test.cpp */; }; + 392688CD20B2D1D600721762 /* interval_set_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B841DCB1E8300CF7FC9 /* interval_set_test.cpp */; }; + 392688CE20B2D1D600721762 /* locality_scorer_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B851DCB1E8300CF7FC9 /* locality_scorer_test.cpp */; }; + 392688CF20B2D1D600721762 /* locality_selector_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B861DCB1E8300CF7FC9 /* locality_selector_test.cpp */; }; 3974BB901FB471AB00F265E5 /* ranking_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B881DCB1E8300CF7FC9 /* ranking_tests.cpp */; }; 3974BB911FB471AB00F265E5 /* query_saver_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1347D541B8758E9009050FF /* query_saver_tests.cpp */; }; 3974BB921FB4723000F265E5 /* testingmain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 671C62241AE9229A00076BD0 /* testingmain.cpp */; }; @@ -148,9 +150,6 @@ 39B2B9831FB469ED00AB85A1 /* libminizip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 39B2B9841FB469ED00AB85A1 /* libminizip.a */; }; 39BBC13B1F9FD65C009D1687 /* highlighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39BBC1391F9FD65C009D1687 /* highlighting.cpp */; }; 39BBC13C1F9FD65C009D1687 /* highlighting.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 39BBC13A1F9FD65C009D1687 /* highlighting.hpp */; }; - 39BBC13E1F9FD679009D1687 /* segment_tree_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39BBC13D1F9FD679009D1687 /* segment_tree_tests.cpp */; }; - 39BBC1401F9FD683009D1687 /* point_rect_matcher_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39BBC13F1F9FD683009D1687 /* point_rect_matcher_tests.cpp */; }; - 39BBC1421F9FD68C009D1687 /* highlighting_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39BBC1411F9FD68C009D1687 /* highlighting_tests.cpp */; }; 3D0AEB021FBB102C00AD042B /* libgenerator_tests_support.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D0AEB041FBB102C00AD042B /* libgenerator_tests_support.a */; }; 3D0AEB031FBB102C00AD042B /* libindexer_tests_support.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D0AEB051FBB102C00AD042B /* libindexer_tests_support.a */; }; 3DF37FAA1EA11B380012CB31 /* everywhere_search_callback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3DF37FA81EA11B380012CB31 /* everywhere_search_callback.cpp */; }; @@ -215,7 +214,6 @@ 67BC92F91D22E45900A4A378 /* ranker.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 67BC92F71D22E45900A4A378 /* ranker.hpp */; }; A1347D511B8758C3009050FF /* query_saver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1347D4F1B8758C3009050FF /* query_saver.cpp */; }; A1347D521B8758C3009050FF /* query_saver.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A1347D501B8758C3009050FF /* query_saver.hpp */; }; - A1347D551B8758E9009050FF /* query_saver_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1347D541B8758E9009050FF /* query_saver_tests.cpp */; }; F63CE2BB1FBB206800716AD3 /* city_finder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F63CE2BA1FBB206800716AD3 /* city_finder.cpp */; }; F652D8BE1CFDE1E800FC29A0 /* common.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F652D8BA1CFDE1E800FC29A0 /* common.hpp */; }; F652D8BF1CFDE1E800FC29A0 /* engine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F652D8BB1CFDE1E800FC29A0 /* engine.cpp */; }; @@ -359,6 +357,14 @@ 34F558461DBF2E8100A4FC11 /* libsuccinct.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libsuccinct.a; path = "../../../omim-xcode-build/Debug/libsuccinct.a"; sourceTree = ""; }; 34F558481DBF2EC700A4FC11 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 3913DA501F9FCC88004AA681 /* suggest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = suggest.cpp; sourceTree = ""; }; + 3925B85520B2FB1B00CEFE4D /* libstorage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libstorage.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 392688B020B2D19000721762 /* text_index.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = text_index.cpp; sourceTree = ""; }; + 392688B120B2D19000721762 /* text_index.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = text_index.hpp; sourceTree = ""; }; + 392688B420B2D1BF00721762 /* bookmarks_processor_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bookmarks_processor_tests.cpp; sourceTree = ""; }; + 392688B520B2D1BF00721762 /* mem_search_index_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mem_search_index_tests.cpp; sourceTree = ""; }; + 392688B620B2D1BF00721762 /* results_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = results_tests.cpp; sourceTree = ""; }; + 392688B720B2D1BF00721762 /* region_info_getter_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = region_info_getter_tests.cpp; sourceTree = ""; }; + 392688B820B2D1BF00721762 /* text_index_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = text_index_tests.cpp; sourceTree = ""; }; 397AFE041D6C9AC700F583E7 /* downloader_search_callback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = downloader_search_callback.cpp; sourceTree = ""; }; 397AFE051D6C9AC700F583E7 /* downloader_search_callback.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = downloader_search_callback.hpp; sourceTree = ""; }; 39AEF8351FB4597300943FC9 /* tracer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tracer.cpp; sourceTree = ""; }; @@ -555,6 +561,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 3925B85620B2FB1B00CEFE4D /* libstorage.a in Frameworks */, 3D0AEB021FBB102C00AD042B /* libgenerator_tests_support.a in Frameworks */, 3D0AEB031FBB102C00AD042B /* libindexer_tests_support.a in Frameworks */, 34F558491DBF2EC700A4FC11 /* libz.tbd in Frameworks */, @@ -597,6 +604,8 @@ 0831F24A200E56100034C365 /* base */ = { isa = PBXGroup; children = ( + 392688B020B2D19000721762 /* text_index.cpp */, + 392688B120B2D19000721762 /* text_index.hpp */, 0831F24B200E56100034C365 /* inverted_list.hpp */, 0831F24C200E56100034C365 /* mem_search_index.hpp */, ); @@ -619,6 +628,7 @@ 34F558391DBF2E0E00A4FC11 /* Frameworks */ = { isa = PBXGroup; children = ( + 3925B85520B2FB1B00CEFE4D /* libstorage.a */, 1D4E79A92076190D006B7856 /* libopen_location_code.a */, 3D0AEB041FBB102C00AD042B /* libgenerator_tests_support.a */, 3D0AEB051FBB102C00AD042B /* libindexer_tests_support.a */, @@ -684,6 +694,11 @@ 671C620D1AE9225100076BD0 /* search_tests */ = { isa = PBXGroup; children = ( + 392688B420B2D1BF00721762 /* bookmarks_processor_tests.cpp */, + 392688B520B2D1BF00721762 /* mem_search_index_tests.cpp */, + 392688B720B2D1BF00721762 /* region_info_getter_tests.cpp */, + 392688B620B2D1BF00721762 /* results_tests.cpp */, + 392688B820B2D1BF00721762 /* text_index_tests.cpp */, 39BBC1411F9FD68C009D1687 /* highlighting_tests.cpp */, 39BBC13F1F9FD683009D1687 /* point_rect_matcher_tests.cpp */, 39BBC13D1F9FD679009D1687 /* segment_tree_tests.cpp */, @@ -959,6 +974,7 @@ 3461C9A21D79949600E6E6F5 /* categories_set.hpp in Headers */, 397AFE071D6C9AC700F583E7 /* downloader_search_callback.hpp in Headers */, 675346EE1A40560D00A0A8C3 /* locality_finder.hpp in Headers */, + 392688B320B2D19000721762 /* text_index.hpp in Headers */, 675346EC1A40560D00A0A8C3 /* latlon_match.hpp in Headers */, 3465B2851D5DE71A0021E14D /* viewport_search_callback.hpp in Headers */, A1347D521B8758C3009050FF /* query_saver.hpp in Headers */, @@ -1142,24 +1158,29 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 3974BB8A1FB471AB00F265E5 /* segment_tree_tests.cpp in Sources */, + 392688CF20B2D1D600721762 /* locality_selector_test.cpp in Sources */, 671C62231AE9227C00076BD0 /* string_match_test.cpp in Sources */, - 3974BB881FB471AB00F265E5 /* highlighting_tests.cpp in Sources */, 671C62201AE9227C00076BD0 /* latlon_match_test.cpp in Sources */, - 3974BB891FB471AB00F265E5 /* point_rect_matcher_tests.cpp in Sources */, + 392688CE20B2D1D600721762 /* locality_scorer_test.cpp in Sources */, + 392688C520B2D1D600721762 /* region_info_getter_tests.cpp in Sources */, 671C621F1AE9227C00076BD0 /* keyword_matcher_test.cpp in Sources */, - 3974BB8E1FB471AB00F265E5 /* locality_scorer_test.cpp in Sources */, - 3974BB8C1FB471AB00F265E5 /* house_numbers_matcher_test.cpp in Sources */, + 392688C720B2D1D600721762 /* text_index_tests.cpp in Sources */, + 392688C620B2D1D600721762 /* results_tests.cpp in Sources */, 3974BB901FB471AB00F265E5 /* ranking_tests.cpp in Sources */, 671C62251AE9229A00076BD0 /* testingmain.cpp in Sources */, 671C621D1AE9227C00076BD0 /* house_detector_tests.cpp in Sources */, - 3974BB8D1FB471AB00F265E5 /* interval_set_test.cpp in Sources */, + 392688CD20B2D1D600721762 /* interval_set_test.cpp in Sources */, + 392688CB20B2D1D600721762 /* hotels_filter_test.cpp in Sources */, 3974BB911FB471AB00F265E5 /* query_saver_tests.cpp in Sources */, - 3974BB8F1FB471AB00F265E5 /* locality_selector_test.cpp in Sources */, + 392688C320B2D1D600721762 /* bookmarks_processor_tests.cpp in Sources */, + 392688C420B2D1D600721762 /* mem_search_index_tests.cpp in Sources */, 671C621C1AE9227C00076BD0 /* algos_tests.cpp in Sources */, + 392688CA20B2D1D600721762 /* segment_tree_tests.cpp in Sources */, 671C62211AE9227C00076BD0 /* locality_finder_test.cpp in Sources */, - 3974BB8B1FB471AB00F265E5 /* hotels_filter_test.cpp in Sources */, + 392688CC20B2D1D600721762 /* house_numbers_matcher_test.cpp in Sources */, + 392688C920B2D1D600721762 /* point_rect_matcher_tests.cpp in Sources */, 671C621E1AE9227C00076BD0 /* keyword_lang_matcher_test.cpp in Sources */, + 392688C820B2D1D600721762 /* highlighting_tests.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1171,11 +1192,9 @@ F652D8FA1CFDE21900FC29A0 /* locality_scorer.cpp in Sources */, 349B65891D4F21E5001798E2 /* lazy_centers_table.cpp in Sources */, F652D8FE1CFDE21900FC29A0 /* mwm_context.cpp in Sources */, - 39BBC13E1F9FD679009D1687 /* segment_tree_tests.cpp in Sources */, F652D8F01CFDE21900FC29A0 /* geocoder.cpp in Sources */, F652D8F21CFDE21900FC29A0 /* geometry_cache.cpp in Sources */, 39B2B9401FB461F800AB85A1 /* interactive_search_test.cpp in Sources */, - 34586B8C1DCB1E8300CF7FC9 /* locality_scorer_test.cpp in Sources */, 34EEAD721E55AE5C00E95575 /* utils.cpp in Sources */, 345C8DB11D2D15A50037E3A6 /* geocoder_context.cpp in Sources */, 39B2B9491FB4620200AB85A1 /* pre_ranker_test.cpp in Sources */, @@ -1183,7 +1202,6 @@ 39BBC13B1F9FD65C009D1687 /* highlighting.cpp in Sources */, F652D8BF1CFDE1E800FC29A0 /* engine.cpp in Sources */, 675346DD1A40560D00A0A8C3 /* approximate_string_match.cpp in Sources */, - 34586B8B1DCB1E8300CF7FC9 /* interval_set_test.cpp in Sources */, 0810EC361D6D9D2E00ABFEE7 /* displayed_categories.cpp in Sources */, 675346E51A40560D00A0A8C3 /* intermediate_result.cpp in Sources */, F652D9021CFDE21900FC29A0 /* pre_ranking_info.cpp in Sources */, @@ -1195,6 +1213,7 @@ 67BC92F81D22E45900A4A378 /* ranker.cpp in Sources */, 347F33201C4540A8009758CC /* projection_on_street.cpp in Sources */, 347F33191C4540A8009758CC /* dummy_rank_table.cpp in Sources */, + 392688B220B2D19000721762 /* text_index.cpp in Sources */, F652D8F41CFDE21900FC29A0 /* house_numbers_matcher.cpp in Sources */, F652D8F61CFDE21900FC29A0 /* house_to_street_table.cpp in Sources */, 3465B2841D5DE71A0021E14D /* viewport_search_callback.cpp in Sources */, @@ -1205,13 +1224,11 @@ F652D8C11CFDE1E800FC29A0 /* features_filter.cpp in Sources */, 39B2B94A1FB4620200AB85A1 /* processor_test.cpp in Sources */, F652D8F81CFDE21900FC29A0 /* intersection_result.cpp in Sources */, - 34586B891DCB1E8300CF7FC9 /* hotels_filter_test.cpp in Sources */, 453C623C2004BABE00467120 /* region_info_getter.cpp in Sources */, F63CE2BB1FBB206800716AD3 /* city_finder.cpp in Sources */, F652D9061CFDE21900FC29A0 /* ranking_info.cpp in Sources */, 39B2B94B1FB4620200AB85A1 /* ranker_test.cpp in Sources */, F652D9001CFDE21900FC29A0 /* nested_rects_cache.cpp in Sources */, - 34586B8D1DCB1E8300CF7FC9 /* locality_selector_test.cpp in Sources */, 344A71381F3DA03200B8DDB8 /* segment_tree.cpp in Sources */, 39B2B94F1FB4620800AB85A1 /* tracer_tests.cpp in Sources */, 3441CE501CFC1D7000CF30D4 /* processor.cpp in Sources */, @@ -1220,16 +1237,12 @@ F652D8EE1CFDE21900FC29A0 /* features_layer.cpp in Sources */, 675346E21A40560D00A0A8C3 /* house_detector.cpp in Sources */, 345C8DAF1D2D15A50037E3A6 /* cbv.cpp in Sources */, - 34586B8A1DCB1E8300CF7FC9 /* house_numbers_matcher_test.cpp in Sources */, F659FC6D1CF4A30B000A06B1 /* pre_ranker.cpp in Sources */, - 34586B8F1DCB1E8300CF7FC9 /* ranking_tests.cpp in Sources */, - 39BBC1401F9FD683009D1687 /* point_rect_matcher_tests.cpp in Sources */, 39B2B94C1FB4620200AB85A1 /* search_edited_features_test.cpp in Sources */, F652D9081CFDE21900FC29A0 /* ranking_utils.cpp in Sources */, 3465B2821D5DE71A0021E14D /* search_params.cpp in Sources */, 347F33241C4540A8009758CC /* retrieval.cpp in Sources */, 3913DA511F9FCC88004AA681 /* suggest.cpp in Sources */, - A1347D551B8758E9009050FF /* query_saver_tests.cpp in Sources */, F652D90B1CFDE21900FC29A0 /* street_vicinity_loader.cpp in Sources */, 3459A7A71E4C4D0200ED235F /* geocoder_locality.cpp in Sources */, 675346ED1A40560D00A0A8C3 /* locality_finder.cpp in Sources */, @@ -1254,7 +1267,6 @@ 3453BD5A1DAF91C100380ECB /* hotels_filter.cpp in Sources */, 345C8DB31D2D15A50037E3A6 /* streets_matcher.cpp in Sources */, 456E1B3E1F9A3C8E009C32E1 /* cities_boundaries_table.cpp in Sources */, - 39BBC1421F9FD68C009D1687 /* highlighting_tests.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; };