[tracker] libtracker-fts: Fix OR search



commit 1200fbc1e44f89b2141caae0dd210e48ad6f677e
Author: Jürg Billeter <j bitron ch>
Date:   Thu Mar 11 14:51:18 2010 +0100

    libtracker-fts: Fix OR search
    
    Check token for 'or' before checking minimum word length.

 src/libtracker-fts/tracker-fts.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/libtracker-fts/tracker-fts.c b/src/libtracker-fts/tracker-fts.c
index 23e9e5d..72bdf7c 100644
--- a/src/libtracker-fts/tracker-fts.c
+++ b/src/libtracker-fts/tracker-fts.c
@@ -4341,11 +4341,6 @@ static int tokenizeSegment(
       break;
      }
 
-    /* If prefix search ignore the word lenght limit */
-    if( nToken < v->min_word_length && !(iEnd<nSegment && pSegment[iEnd]=='*') ){
-      continue;
-    }
-
 //   printf("token being indexed  is %s, pos is %d, begin is %d, end is %d and length is %d\n", pToken, iPos, iBegin, iEnd, nToken);
 
     if( !inPhrase &&
@@ -4402,8 +4397,14 @@ static int tokenizeSegment(
       continue;
     }
 
-    if (stop_word != 0 && !(iEnd<nSegment && pSegment[iEnd]=='*')) {
-	continue;
+    /* If prefix search ignore the word length limit and stop words */
+    if (!(iEnd<nSegment && pSegment[iEnd] == '*')) {
+      if (nToken < v->min_word_length) {
+        continue;
+      }
+      if (stop_word != 0) {
+        continue;
+      }
     }
 
     queryAdd(pQuery, pToken, nToken);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]