Check if entries are already in the clucene index/remove queue. This fix duplivated entries in the database. Don't check if delete files are text files because this will probably fail.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39181 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler
2010-10-29 07:53:22 +00:00
parent b63e3a348c
commit 86795bae5b
2 changed files with 13 additions and 3 deletions
@@ -72,17 +72,27 @@ CLuceneWriteDataBase::InitCheck()
status_t
CLuceneWriteDataBase::AddDocument(const entry_ref& ref)
{
// check if already in the queue
for (unsigned int i = 0; i < fAddQueue.size(); i++) {
if (fAddQueue.at(i) == ref)
return B_OK;
}
fAddQueue.push_back(ref);
return B_ERROR;
return B_OK;
}
status_t
CLuceneWriteDataBase::RemoveDocument(const entry_ref& ref)
{
// check if already in the queue
for (unsigned int i = 0; i < fAddQueue.size(); i++) {
if (fDeleteQueue.at(i) == ref)
return B_OK;
}
fDeleteQueue.push_back(ref);
return B_ERROR;
return B_OK;
}
@@ -81,7 +81,7 @@ FullTextAnalyser::AnalyseEntry(const entry_ref& ref)
void
FullTextAnalyser::DeleteEntry(const entry_ref& ref)
{
if (!_InterestingEntry(ref))
if (_IsInIndexDirectory(ref))
return;
STRACE("FullTextAnalyser DeleteEntry: %s\n", ref.name);
fWriteDataBase->RemoveDocument(ref);