mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-22 11:22:38 -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) {
|
if (pattern != NULL) {
|
||||||
std::cout << "Searching suggestions for: " << pattern << std::endl;
|
std::cout << "Searching suggestions for: " << pattern << std::endl;
|
||||||
|
kiwix::SuggestionsList_t suggestions;
|
||||||
reader->searchSuggestionsSmart(pattern, 10);
|
reader->searchSuggestionsSmart(pattern, 10, suggestions);
|
||||||
while (reader->getNextSuggestion(suggestion)) {
|
for (auto& suggestion: suggestions) {
|
||||||
std::cout << suggestion << std::endl;
|
std::cout << suggestion[0] << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user