mirror of https://github.com/kiwix/libkiwix.git
Use new libzim method `hasFulltextIndex` to check for fulltext index.
This commit is contained in:
parent
ba302bed33
commit
d51000c4a9
|
@ -390,18 +390,7 @@ bool Reader::hasFulltextIndex() const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto path: {"Z//fulltextIndex/xapian", "X/fulltext/xapian"}) {
|
return zimArchive->hasFulltextIndex();
|
||||||
try {
|
|
||||||
auto entry = zimArchive->getEntryByPath(path);
|
|
||||||
auto item = entry.getItem(true);
|
|
||||||
auto accessInfo = item.getDirectAccessInformation();
|
|
||||||
if (accessInfo.second) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} catch(...) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Search titles by prefix */
|
/* Search titles by prefix */
|
||||||
|
|
Loading…
Reference in New Issue