mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-22 03:12:20 -04:00
Use new suggestion API of kiwix-lib.
Old API is not threadsafe and is deprecated.
This commit is contained in:
parent
4120e7fd25
commit
4a944cc901
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user