[xapian]:add zim fullindex xapian support

This commit is contained in:
Xiao YiFang 2022-10-06 09:15:59 +08:00
parent c06e2a27c1
commit 55d7c6ee2b

6
zim.cc
View file

@ -1031,9 +1031,11 @@ void ZimDictionary::makeFTSIndex( QAtomicInt & isCancelled, bool firstIteration
gdDebug( "Zim: Building the full-text index for dictionary: %s\n", gdDebug( "Zim: Building the full-text index for dictionary: %s\n",
getName().c_str() ); getName().c_str() );
try try
{ {
#ifdef USE_XAPIAN
return FtsHelpers::makeFTSIndexXapian(this,isCancelled);
#endif
Mutex::Lock _( getFtsMutex() ); Mutex::Lock _( getFtsMutex() );
File::Class ftsIdx( ftsIndexName(), "wb" ); File::Class ftsIdx( ftsIndexName(), "wb" );
@ -1541,7 +1543,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
try try
{ {
if ( Dictionary::needToRebuildIndex( dictFiles, indexFile ) || if ( Dictionary::needToRebuildBTreeIndex( dictFiles, indexFile ) ||
indexIsOldOrBad( indexFile ) ) indexIsOldOrBad( indexFile ) )
{ {
gdDebug( "Zim: Building the index for dictionary: %s\n", i->c_str() ); gdDebug( "Zim: Building the index for dictionary: %s\n", i->c_str() );