jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1504387 - /jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndex.java
Date Thu, 18 Jul 2013 08:30:33 GMT
Author: jukka
Date: Thu Jul 18 08:30:33 2013
New Revision: 1504387

URL: http://svn.apache.org/r1504387
Log:
OAK-912: Lucene index only filters the first contains clause

Use all full text constraints

Modified:
    jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndex.java

Modified: jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndex.java?rev=1504387&r1=1504386&r2=1504387&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndex.java
Thu Jul 18 08:30:33 2013
@@ -74,6 +74,8 @@ import org.apache.lucene.store.FSDirecto
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.collect.Lists;
+
 /**
  * Provides a QueryIndex that does lookups against a Lucene-based index
  * 
@@ -411,8 +413,10 @@ public class LuceneIndex implements Full
                 || filter.getFulltextConditions().isEmpty()) {
             return;
         }
-        List<String> tokens = tokenize(filter.getFulltextConditions()
-                .iterator().next().toLowerCase());
+        List<String> tokens = Lists.newArrayList();
+        for (String condition : filter.getFulltextConditions()) {
+            tokens.addAll(tokenize(condition.toLowerCase()));
+        }
         if (tokens.size() == 1) {
             String token = tokens.get(0);
             if (token.contains(" ")) {



Mime
View raw message