From 4a944cc901d4205db0ec6b49ee5672d428ff8bfa Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 1 Jul 2020 16:51:41 +0200 Subject: [PATCH] Use new suggestion API of kiwix-lib. Old API is not threadsafe and is deprecated. --- src/reader/kiwix-read.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/reader/kiwix-read.cpp b/src/reader/kiwix-read.cpp index 22822f5..a50d44f 100644 --- a/src/reader/kiwix-read.cpp +++ b/src/reader/kiwix-read.cpp @@ -90,10 +90,10 @@ int main(int argc, char** argv) if (pattern != NULL) { std::cout << "Searching suggestions for: " << pattern << std::endl; - - reader->searchSuggestionsSmart(pattern, 10); - while (reader->getNextSuggestion(suggestion)) { - std::cout << suggestion << std::endl; + kiwix::SuggestionsList_t suggestions; + reader->searchSuggestionsSmart(pattern, 10, suggestions); + for (auto& suggestion: suggestions) { + std::cout << suggestion[0] << std::endl; } }