diff --git a/map/map_tests/search_api_tests.cpp b/map/map_tests/search_api_tests.cpp index 248d0c4e16..9e97e379ee 100644 --- a/map/map_tests/search_api_tests.cpp +++ b/map/map_tests/search_api_tests.cpp @@ -145,6 +145,7 @@ UNIT_CLASS_TEST(SearchAPITest, BookmarksSearch) kml::SetDefaultStr(data.m_name, "Great Northern Hotel"); kml::SetDefaultStr(data.m_description, "Clean place with a reasonable price"); marks.emplace_back(2, data); + m_api.EnableIndexingOfBookmarksDescriptions(true); m_api.OnBookmarksCreated(marks); m_api.OnViewportChanged(m2::RectD(-1, -1, 1, 1)); diff --git a/map/search_api.cpp b/map/search_api.cpp index 295641efb0..70ea3f1c4e 100644 --- a/map/search_api.cpp +++ b/map/search_api.cpp @@ -390,6 +390,11 @@ void SearchAPI::FilterAllHotelsInViewport(m2::RectD const & viewport, m_delegate.FilterHotels(filterTasks, move(featureIds)); } +void SearchAPI::EnableIndexingOfBookmarksDescriptions(bool enable) +{ + m_engine.EnableIndexingOfBookmarksDescriptions(enable); +} + void SearchAPI::OnBookmarksCreated(vector const & marks) { vector data; diff --git a/map/search_api.hpp b/map/search_api.hpp index d199977b3d..dad366fc02 100644 --- a/map/search_api.hpp +++ b/map/search_api.hpp @@ -144,6 +144,8 @@ public: void FilterAllHotelsInViewport(m2::RectD const & viewport, booking::filter::Tasks const & filterTasks) override; + void EnableIndexingOfBookmarksDescriptions(bool enable); + void OnBookmarksCreated(std::vector const & marks); void OnBookmarksUpdated(std::vector const & marks); void OnBookmarksDeleted(std::vector const & marks); diff --git a/search/engine.cpp b/search/engine.cpp index f11959ea20..cbef1c673d 100644 --- a/search/engine.cpp +++ b/search/engine.cpp @@ -158,6 +158,13 @@ void Engine::LoadCountriesTree() [](Processor & processor) { processor.LoadCountriesTree(); }); } +void Engine::EnableIndexingOfBookmarksDescriptions(bool enable) +{ + PostMessage(Message::TYPE_BROADCAST, [enable](Processor & processor) { + processor.EnableIndexingOfBookmarksDescriptions(enable); + }); +} + void Engine::OnBookmarksCreated(vector> const & marks) { PostMessage(Message::TYPE_BROADCAST, diff --git a/search/engine.hpp b/search/engine.hpp index 776a777832..3dd8f03a0b 100644 --- a/search/engine.hpp +++ b/search/engine.hpp @@ -108,6 +108,8 @@ public: // Posts request to load countries tree. void LoadCountriesTree(); + void EnableIndexingOfBookmarksDescriptions(bool enable); + void OnBookmarksCreated(std::vector> const & marks); void OnBookmarksUpdated(std::vector> const & marks); void OnBookmarksDeleted(std::vector const & marks); diff --git a/search/processor.cpp b/search/processor.cpp index fa0da702fa..35e55c8f73 100644 --- a/search/processor.cpp +++ b/search/processor.cpp @@ -324,6 +324,11 @@ void Processor::LoadCitiesBoundaries() void Processor::LoadCountriesTree() { m_ranker.LoadCountriesTree(); } +void Processor::EnableIndexingOfBookmarksDescriptions(bool enable) +{ + m_bookmarksProcessor.EnableIndexingOfDescriptions(enable); +} + void Processor::OnBookmarksCreated(vector> const & marks) { for (auto const & idDoc : marks) diff --git a/search/processor.hpp b/search/processor.hpp index 2fb992700b..ece6fcd1bb 100644 --- a/search/processor.hpp +++ b/search/processor.hpp @@ -94,6 +94,8 @@ public: void LoadCitiesBoundaries(); void LoadCountriesTree(); + void EnableIndexingOfBookmarksDescriptions(bool enable); + void OnBookmarksCreated(std::vector> const & marks); void OnBookmarksUpdated(std::vector> const & marks); void OnBookmarksDeleted(std::vector const & marks);