mirror of https://github.com/kiwix/libkiwix.git
Fix ft index open for chunked files #346
This commit is contained in:
parent
5ff4abfab2
commit
1c68cf87b9
|
@ -40,14 +40,13 @@ namespace kiwix {
|
||||||
{
|
{
|
||||||
zim::File zimFile = zim::File(directoryPath);
|
zim::File zimFile = zim::File(directoryPath);
|
||||||
zim::Article xapianArticle = zimFile.getArticle('Z', "/fulltextIndex/xapian");
|
zim::Article xapianArticle = zimFile.getArticle('Z', "/fulltextIndex/xapian");
|
||||||
if ( ! xapianArticle.good())
|
if (!xapianArticle.good())
|
||||||
throw NoXapianIndexInZim();
|
throw NoXapianIndexInZim();
|
||||||
zim::offset_type dbOffset = xapianArticle.getOffset();
|
zim::offset_type dbOffset = xapianArticle.getOffset();
|
||||||
int databasefd = open(directoryPath.c_str(), O_RDONLY);
|
int databasefd = open(directoryPath.c_str(), O_RDONLY);
|
||||||
lseek(databasefd, dbOffset, SEEK_SET);
|
lseek(databasefd, dbOffset, SEEK_SET);
|
||||||
this->readableDatabase = Xapian::Database(databasefd);
|
this->readableDatabase = Xapian::Database(databasefd);
|
||||||
} catch (zim::ZimFileFormatError)
|
} catch (...) {
|
||||||
{
|
|
||||||
this->readableDatabase = Xapian::Database(directoryPath);
|
this->readableDatabase = Xapian::Database(directoryPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue