jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1386659 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/query/lucene/ test/java/org/apache/jackrabbit/core/query/
Date Mon, 17 Sep 2012 15:27:53 GMT
Author: alexparvulescu
Date: Mon Sep 17 15:27:53 2012
New Revision: 1386659

URL: http://svn.apache.org/viewvc?rev=1386659&view=rev
Log:
Partial search terms are no longer highlighted in the excerpts

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/CaseTermQuery.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardQuery.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ExcerptTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/CaseTermQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/CaseTermQuery.java?rev=1386659&r1=1386658&r2=1386659&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/CaseTermQuery.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/CaseTermQuery.java
Mon Sep 17 15:27:53 2012
@@ -47,7 +47,7 @@ abstract class CaseTermQuery extends Mul
     CaseTermQuery(Term term, int transform) {
         this.term = term;
         this.transform = transform;
-        setRewriteMethod(CONSTANT_SCORE_FILTER_REWRITE);
+        setRewriteMethod(CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE);
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardQuery.java?rev=1386659&r1=1386658&r2=1386659&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardQuery.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardQuery.java
Mon Sep 17 15:27:53 2012
@@ -198,7 +198,7 @@ public class WildcardQuery extends Query
             this.tvf = tvf;
             this.pattern = pattern;
             this.transform = transform;
-            setRewriteMethod(CONSTANT_SCORE_FILTER_REWRITE);
+            setRewriteMethod(CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE);
         }
 
         @Override

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ExcerptTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ExcerptTest.java?rev=1386659&r1=1386658&r2=1386659&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ExcerptTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ExcerptTest.java
Mon Sep 17 15:27:53 2012
@@ -239,6 +239,34 @@ public class ExcerptTest extends Abstrac
         checkExcerpt(content, expectedExcerpt, jTest);
     }
 
+    /**
+     * test for https://issues.apache.org/jira/browse/JCR-3428
+     * 
+     * when given an incomplete fulltext search token, the excerpt should
+     * highlight the entire matching token
+     * 
+     */
+    public void testEagerMatch() throws RepositoryException {
+        checkExcerpt("lorem ipsum dolor sit amet",
+                "lorem <strong>ipsum</strong> dolor sit amet", "ipsu*");
+    }
+
+    /**
+     * @see #testEagerMatch()
+     */
+    public void testEagerMatch2() throws RepositoryException {
+        checkExcerpt("lorem ipsum dolor sit amet",
+                "<strong>lorem</strong> <strong>ipsum</strong> dolor
sit amet",
+                "lorem ipsu*");
+    }
+
+    /**
+     * @see #testEagerMatch()
+     */
+    public void testEagerMatch3() throws RepositoryException {
+        checkExcerpt("lorem ipsum dolor sit amet",
+                "lorem <strong>ipsum</strong> <strong>dolor</strong>
sit amet", "ipsu* dolor");
+    }
 
     private void checkExcerpt(String text, String fragmentText, String terms)
             throws RepositoryException {



Mime
View raw message