Add index count;

[Fix] Duplicate index issue.
This commit is contained in:
zhangpengfei 2021-01-12 18:54:51 +08:00
parent b121075b10
commit 6465ea2457
2 changed files with 3 additions and 1 deletions

View File

@ -45,7 +45,7 @@ void Document::setUniqueTerm(QString term)
{ {
if(term.isEmpty()) if(term.isEmpty())
return; return;
// m_document->add_term(term.toStdString()); m_document->add_term(term.toStdString());
m_unique_term = new QString(term); m_unique_term = new QString(term);
} }

View File

@ -56,6 +56,7 @@ bool IndexGenerator::creatAllIndex(QQueue<QVector<QString> > *messageList)
count = 0; count = 0;
m_datebase_path->commit(); m_datebase_path->commit();
} }
FileUtils::_current_index_count += 1;
} }
m_datebase_path->commit(); m_datebase_path->commit();
} }
@ -353,6 +354,7 @@ bool IndexGenerator::deleteAllIndex(QStringList *pathlist)
qDebug()<<"delete path"<<doc; qDebug()<<"delete path"<<doc;
qDebug()<<"delete md5"<<QString::fromStdString(uniqueterm); qDebug()<<"delete md5"<<QString::fromStdString(uniqueterm);
m_datebase_path->commit(); m_datebase_path->commit();
FileUtils::_current_index_count -= 1;
qDebug()<< "--delete finish--"; qDebug()<< "--delete finish--";
} }
catch(const Xapian::Error &e) catch(const Xapian::Error &e)