[haiku-commits] r39179 - haiku/trunk/src/add-ons/index_server/FullText

  • From: clemens.zeidler@xxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 29 Oct 2010 00:20:04 +0200 (CEST)

Author: czeidler
Date: 2010-10-29 00:20:04 +0200 (Fri, 29 Oct 2010)
New Revision: 39179
Changeset: http://dev.haiku-os.org/changeset/39179

Modified:
   haiku/trunk/src/add-ons/index_server/FullText/FullTextAnalyser.cpp
Log:
Don't analyse files in own clucene index directories.



Modified: haiku/trunk/src/add-ons/index_server/FullText/FullTextAnalyser.cpp
===================================================================
--- haiku/trunk/src/add-ons/index_server/FullText/FullTextAnalyser.cpp  
2010-10-28 21:24:50 UTC (rev 39178)
+++ haiku/trunk/src/add-ons/index_server/FullText/FullTextAnalyser.cpp  
2010-10-28 22:20:04 UTC (rev 39179)
@@ -68,13 +68,6 @@
 {
        if (!_InterestingEntry(ref))
                return;
-       BPath path(&ref);
-       if (BString(path.Path()).FindFirst(fDataBasePath.Path()) == 0) {
-               STRACE("In database path %s\n", path.Path());
-               return;
-       }
-       if (BString(path.Path()).FindFirst("/boot/common/cache/tmp") == 0)
-               return;
 
        //STRACE("FullTextAnalyser AnalyseEntry: %s %s\n", ref.name, 
path.Path());
        fWriteDataBase->AddDocument(ref);
@@ -88,6 +81,8 @@
 void
 FullTextAnalyser::DeleteEntry(const entry_ref& ref)
 {
+       if (!_InterestingEntry(ref))
+               return;
        STRACE("FullTextAnalyser DeleteEntry: %s\n", ref.name);
        fWriteDataBase->RemoveDocument(ref);
 }
@@ -131,11 +126,13 @@
 bool
 FullTextAnalyser::_IsInIndexDirectory(const entry_ref& ref)
 {
-       BEntry entry(&ref);
-       BDirectory dataBaseDir(fDataBasePath.Path());
-       if (dataBaseDir.Contains(&entry))
+       BPath path(&ref);
+       if (BString(path.Path()).FindFirst(fDataBasePath.Path()) == 0)
                return true;
 
+       if (BString(path.Path()).FindFirst("/boot/common/cache/tmp") == 0)
+               return true;
+
        return false;
 }
 


Other related posts:

  • » [haiku-commits] r39179 - haiku/trunk/src/add-ons/index_server/FullText - clemens . zeidler