Update kiwix-search.cpp for a bug fix

This commit is contained in:
arjun-369 2021-04-07 17:32:07 +05:30 committed by Matthieu Gautier
parent b2aeb08051
commit 6f2316bc8a

View File

@ -104,7 +104,14 @@ int main(int argc, char** argv)
if (reader) {
searcher = new kiwix::Searcher();
searcher->add_reader(reader);
bool contians_FTIndex=searcher->add_reader(reader);
if(!contians_FTIndex){
std::cerr << "The Zim file does not contain a full-text index." << std::endl;
if(suggestionFlag){
exit(0);
}
exit(1);
}
} else {
cerr << "Unable to search through zim '" << zimPath << "'." << endl;
exit(1);