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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user