Use new suggestion API of kiwix-lib.

Old API is not threadsafe and is deprecated.
This commit is contained in:
Matthieu Gautier 2020-07-01 16:51:41 +02:00
parent 4120e7fd25
commit 4a944cc901

View File

@ -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;
}
}