jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1444685 - in /jackrabbit/branches/2.6: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RangeQuery.java
Date Mon, 11 Feb 2013 09:04:27 GMT
Author: alexparvulescu
Date: Mon Feb 11 09:04:27 2013
New Revision: 1444685

URL: http://svn.apache.org/r1444685
Log:
JCR-3513 Slower range query execution - backport to 2.6

Modified:
    jackrabbit/branches/2.6/   (props changed)
    jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RangeQuery.java

Propchange: jackrabbit/branches/2.6/
------------------------------------------------------------------------------
  Merged /jackrabbit/trunk:r1444683

Modified: jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RangeQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RangeQuery.java?rev=1444685&r1=1444684&r2=1444685&view=diff
==============================================================================
--- jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RangeQuery.java
(original)
+++ jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RangeQuery.java
Mon Feb 11 09:04:27 2013
@@ -22,6 +22,7 @@ import org.apache.lucene.index.TermDocs;
 import org.apache.lucene.index.TermEnum;
 import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.Explanation;
+import org.apache.lucene.search.MultiTermQuery;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.Scorer;
 import org.apache.lucene.search.Searcher;
@@ -148,8 +149,11 @@ public class RangeQuery extends Query im
      */
     public Query rewrite(IndexReader reader) throws IOException {
         if (transform == TRANSFORM_NONE) {
-            Query stdRangeQueryImpl
-                    = new TermRangeQuery(lowerTerm.field(), lowerTerm.text(), upperTerm.text(),
inclusive, inclusive);
+            TermRangeQuery stdRangeQueryImpl = new TermRangeQuery(
+                    lowerTerm.field(), lowerTerm.text(), upperTerm.text(),
+                    inclusive, inclusive);
+            stdRangeQueryImpl
+                    .setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE);
             try {
                 stdRangeQuery = stdRangeQueryImpl.rewrite(reader);
                 return stdRangeQuery;



Mime
View raw message