From d51000c4a9680bc108d89ca6f41e5b53257336bc Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 8 Dec 2020 18:53:38 +0100 Subject: [PATCH] Use new libzim method `hasFulltextIndex` to check for fulltext index. --- src/reader.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/reader.cpp b/src/reader.cpp index 5dfaaf15f..862f61bd5 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -390,18 +390,7 @@ bool Reader::hasFulltextIndex() const return false; } - for(auto path: {"Z//fulltextIndex/xapian", "X/fulltext/xapian"}) { - try { - auto entry = zimArchive->getEntryByPath(path); - auto item = entry.getItem(true); - auto accessInfo = item.getDirectAccessInformation(); - if (accessInfo.second) { - return true; - } - } catch(...) {} - } - - return false; + return zimArchive->hasFulltextIndex(); } /* Search titles by prefix */