Merge pull request #72 from iaom/0112-dev

Add index count,Fix duplicate index issue.
This commit is contained in:
张佳萍 2021-01-13 09:35:53 +08:00 committed by GitHub
commit 5fedf6e9eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

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

View File

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