jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebast...@apache.org
Subject svn commit: r1060863 [2/2] - in /jackrabbit/sandbox/JCR-2415-lucene-3.0: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ jackrabbit-core/src/main/java/org/apache/...
Date Wed, 19 Jan 2011 16:51:09 GMT
Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java Wed Jan 19 16:51:07 2011
@@ -814,14 +814,10 @@ public class NodeIndexer {
             tv = Field.TermVector.NO;
         }
         if (store) {
-            // store field compressed if greater than 16k
-            Field.Store stored;
-            if (value.length() > 0x4000) {
-                stored = Field.Store.COMPRESS;
-            } else {
-                stored = Field.Store.YES;
-            }
-            return new Field(FieldNames.FULLTEXT, value, stored,
+            // We would be able to store the field compressed or not depending
+            // on a criterion but then we could not determine later is this field
+            // has been compressed or not, so we choose to store it uncompressed
+            return new Field(FieldNames.FULLTEXT, value, Field.Store.YES,
                     Field.Index.ANALYZED, tv);
         } else {
             return new Field(FieldNames.FULLTEXT, value,

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeTraversingQueryHits.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeTraversingQueryHits.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeTraversingQueryHits.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeTraversingQueryHits.java Wed Jan 19 16:51:07 2011
@@ -37,7 +37,7 @@ public class NodeTraversingQueryHits ext
     /**
      * The nodes to traverse.
      */
-    private final Iterator nodes;
+    private final Iterator<Node> nodes;
 
     /**
      * Creates query hits that consist of the nodes that are traversed from a

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NotQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NotQuery.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NotQuery.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NotQuery.java Wed Jan 19 16:51:07 2011
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.core.query.lucene;
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.Explanation;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.Scorer;
@@ -33,6 +34,7 @@ import java.util.Set;
  * Documents that did not match the context query will be selected by this
  * <code>NotQuery</code>.
  */
+@SuppressWarnings("serial")
 class NotQuery extends Query {
 
     /**
@@ -56,7 +58,7 @@ class NotQuery extends Query {
     /**
      * {@inheritDoc}
      */
-    protected Weight createWeight(Searcher searcher) {
+    public Weight createWeight(Searcher searcher) {
         return new NotQueryWeight(searcher);
     }
 
@@ -89,7 +91,7 @@ class NotQuery extends Query {
     /**
      * Implements a weight for this <code>NotQuery</code>.
      */
-    private class NotQueryWeight implements Weight {
+    private class NotQueryWeight extends Weight {
 
         /**
          * The searcher to access the index.
@@ -134,8 +136,9 @@ class NotQuery extends Query {
         /**
          * @inheritDoc
          */
-        public Scorer scorer(IndexReader reader) throws IOException {
-            contextScorer = context.weight(searcher).scorer(reader);
+        public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder,
+                boolean topScorer) throws IOException {
+            contextScorer = context.weight(searcher).scorer(reader, scoreDocsInOrder, topScorer);
             return new NotQueryScorer(reader);
         }
 
@@ -183,8 +186,9 @@ class NotQuery extends Query {
         public boolean next() throws IOException {
             if (docNo == -1) {
                 // get first doc of context scorer
-                if (contextScorer.next()) {
-                    contextNo = contextScorer.doc();
+                int docId = contextScorer.nextDoc();
+                if (docId != DocIdSetIterator.NO_MORE_DOCS) {
+                    contextNo = docId;
                 }
             }
             // move to next candidate
@@ -195,8 +199,9 @@ class NotQuery extends Query {
             // check with contextScorer
             while (contextNo != -1 && contextNo == docNo) {
                 docNo++;
-                if (contextScorer.next()) {
-                    contextNo = contextScorer.doc();
+                int docId = contextScorer.nextDoc();
+                if (docId != DocIdSetIterator.NO_MORE_DOCS) {
+                    contextNo = docId;
                 } else {
                     contextNo = -1;
                 }
@@ -223,8 +228,9 @@ class NotQuery extends Query {
          */
         public boolean skipTo(int target) throws IOException {
             if (contextNo != -1 && contextNo < target) {
-                if (contextScorer.skipTo(target)) {
-                    contextNo = contextScorer.doc();
+                int docId = contextScorer.advance(target);
+                if (docId != DocIdSetIterator.NO_MORE_DOCS) {
+                    contextNo = docId;
                 } else {
                     contextNo = -1;
                 }

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/OffsetCharSequence.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/OffsetCharSequence.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/OffsetCharSequence.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/OffsetCharSequence.java Wed Jan 19 16:51:07 2011
@@ -20,7 +20,7 @@ package org.apache.jackrabbit.core.query
  * CharSequence that applies an offset to a base CharSequence. The base
  * CharSequence can be replaced without creating a new CharSequence.
  */
-final class OffsetCharSequence implements CharSequence, Comparable, TransformConstants {
+final class OffsetCharSequence implements CharSequence, Comparable<OffsetCharSequence>, TransformConstants {
 
     /**
      * Indicates how the underlying char sequence is exposed / tranformed.
@@ -128,8 +128,7 @@ final class OffsetCharSequence implement
      * @return as defined in {@link String#compareTo(Object)} but also takes
      *         {@link #transform} into account.
      */
-    public int compareTo(Object o) {
-        OffsetCharSequence other = (OffsetCharSequence) o;
+    public int compareTo(OffsetCharSequence other) {
         int len1 = length();
         int len2 = other.length();
         int lim = Math.min(len1, len2);

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ParentAxisQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ParentAxisQuery.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ParentAxisQuery.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ParentAxisQuery.java Wed Jan 19 16:51:07 2011
@@ -22,12 +22,12 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.jackrabbit.core.query.lucene.hits.AbstractHitCollector;
 import org.apache.jackrabbit.core.query.lucene.hits.Hits;
 import org.apache.jackrabbit.core.query.lucene.hits.ScorerHits;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.search.Explanation;
-import org.apache.lucene.search.HitCollector;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.Scorer;
 import org.apache.lucene.search.Searcher;
@@ -37,6 +37,7 @@ import org.apache.lucene.search.Weight;
 /**
  * <code>ParentAxisQuery</code> selects the parent nodes of a context query.
  */
+@SuppressWarnings("serial")
 class ParentAxisQuery extends Query {
 
     /**
@@ -89,7 +90,7 @@ class ParentAxisQuery extends Query {
      * @param searcher the <code>Searcher</code> instance to use.
      * @return a <code>ParentAxisWeight</code>.
      */
-    protected Weight createWeight(Searcher searcher) {
+    public Weight createWeight(Searcher searcher) {
         return new ParentAxisWeight(searcher);
     }
 
@@ -133,7 +134,7 @@ class ParentAxisQuery extends Query {
     /**
      * The <code>Weight</code> implementation for this <code>ParentAxisQuery</code>.
      */
-    private class ParentAxisWeight implements Weight {
+    private class ParentAxisWeight extends Weight {
 
         /**
          * The searcher in use
@@ -186,8 +187,9 @@ class ParentAxisQuery extends Query {
          * @return a <code>ParentAxisScorer</code>.
          * @throws IOException if an error occurs while reading from the index.
          */
-        public Scorer scorer(IndexReader reader) throws IOException {
-            contextScorer = contextQuery.weight(searcher).scorer(reader);
+        public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder,
+                boolean topScorer) throws IOException {
+            contextScorer = contextQuery.weight(searcher).scorer(reader, scoreDocsInOrder, topScorer);
             HierarchyResolver resolver = (HierarchyResolver) reader;
             return new ParentAxisScorer(searcher.getSimilarity(),
                     reader, searcher, resolver);
@@ -317,36 +319,38 @@ class ParentAxisQuery extends Query {
                 hits = new BitSet(reader.maxDoc());
 
                 final IOException[] ex = new IOException[1];
-                contextScorer.score(new HitCollector() {
-
-                    private int[] docs = new int[1];
-
-                    public void collect(int doc, float score) {
-                        try {
-                            docs = hResolver.getParents(doc, docs);
-                            if (docs.length == 1) {
-                                // optimize single value
-                                hits.set(docs[0]);
-                                if (firstScore == null) {
-                                    firstScore = score;
-                                } else if (firstScore != score) {
-                                    scores.put(doc, score);
-                                }
-                            } else {
-                                for (int docNum : docs) {
-                                    hits.set(docNum);
+                if (contextScorer != null) {
+                    contextScorer.score(new AbstractHitCollector() {
+                        private int[] docs = new int[1];
+
+                        @Override
+                        protected void collect(int doc, float score) {
+                            try {
+                                docs = hResolver.getParents(doc, docs);
+                                if (docs.length == 1) {
+                                    // optimize single value
+                                    hits.set(docs[0]);
                                     if (firstScore == null) {
                                         firstScore = score;
                                     } else if (firstScore != score) {
                                         scores.put(doc, score);
                                     }
+                                } else {
+                                    for (int docNum : docs) {
+                                        hits.set(docNum);
+                                        if (firstScore == null) {
+                                            firstScore = score;
+                                        } else if (firstScore != score) {
+                                            scores.put(doc, score);
+                                        }
+                                    }
                                 }
+                            } catch (IOException e) {
+                                ex[0] = e;
                             }
-                        } catch (IOException e) {
-                            ex[0] = e;
                         }
-                    }
-                });
+                    });
+                }
 
                 if (ex[0] != null) {
                     throw ex[0];
@@ -355,7 +359,7 @@ class ParentAxisQuery extends Query {
                 // filter out documents that do not match the name test
                 if (nameTest != null) {
                     Query nameQuery = new NameQuery(nameTest, version, nsMappings);
-                    Hits nameHits = new ScorerHits(nameQuery.weight(searcher).scorer(reader));
+                    Hits nameHits = new ScorerHits(nameQuery.weight(searcher).scorer(reader, true, false));
                     for (int i = hits.nextSetBit(0); i >= 0; i = hits.nextSetBit(i + 1)) {
                         int doc = nameHits.skipTo(i);
                         if (doc == -1) {

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PersistentIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PersistentIndex.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PersistentIndex.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PersistentIndex.java Wed Jan 19 16:51:07 2011
@@ -130,7 +130,7 @@ class PersistentIndex extends AbstractIn
         byte[] buffer = new byte[1024];
         Directory dir = index.getDirectory();
         Directory dest = getDirectory();
-        String[] files = dir.list();
+        String[] files = dir.listAll();
         for (String file : files) {
             IndexInput in = dir.openInput(file);
             try {

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PredicateDerefQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PredicateDerefQuery.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PredicateDerefQuery.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PredicateDerefQuery.java Wed Jan 19 16:51:07 2011
@@ -17,17 +17,15 @@
 package org.apache.jackrabbit.core.query.lucene;
 
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.BitSet;
-import java.util.List;
 import java.util.Set;
 
+import org.apache.jackrabbit.core.query.lucene.hits.AbstractHitCollector;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.TermDocs;
 import org.apache.lucene.search.Explanation;
-import org.apache.lucene.search.HitCollector;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.Scorer;
 import org.apache.lucene.search.Searcher;
@@ -38,6 +36,7 @@ import org.apache.lucene.search.Weight;
  * Implements a Lucene <code>Query</code> which returns the nodes which have a 
  * reference property which matches the nodes of the subquery.
  */
+@SuppressWarnings("serial")
 public class PredicateDerefQuery extends Query {
 
     /**
@@ -101,7 +100,7 @@ public class PredicateDerefQuery extends
      * @param searcher the <code>Searcher</code> instance to use.
      * @return a <code>DerefWeight</code>.
      */
-    protected Weight createWeight(Searcher searcher) {
+    public Weight createWeight(Searcher searcher) {
         return new DerefWeight(searcher);
     }
 
@@ -148,7 +147,7 @@ public class PredicateDerefQuery extends
     /**
      * The <code>Weight</code> implementation for this <code>DerefQuery</code>.
      */
-    private class DerefWeight implements Weight {
+    private class DerefWeight extends Weight {
 
         /**
          * The searcher in use
@@ -201,10 +200,11 @@ public class PredicateDerefQuery extends
          * @return a <code>DerefScorer</code>.
          * @throws IOException if an error occurs while reading from the index.
          */
-        public Scorer scorer(IndexReader reader) throws IOException {
-            subQueryScorer = subQuery.weight(searcher).scorer(reader);
+        public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder,
+                boolean topScorer) throws IOException {
+            subQueryScorer = subQuery.weight(searcher).scorer(reader, scoreDocsInOrder, topScorer);
             if (nameTest != null) {
-                nameTestScorer = new NameQuery(nameTest, version, nsMappings).weight(searcher).scorer(reader);
+                nameTestScorer = new NameQuery(nameTest, version, nsMappings).weight(searcher).scorer(reader, scoreDocsInOrder, topScorer);
             }
             return new DerefScorer(searcher.getSimilarity(), reader);
         }
@@ -233,18 +233,13 @@ public class PredicateDerefQuery extends
          * BitSet storing the id's of selected documents
          */
         private final BitSet subQueryHits;
-        
+
         /**
          * BitSet storing the id's of selected documents
          */
         private final BitSet hits;
 
-        /**
-         * List of UUIDs of selected nodes
-         */
-        private List uuids = null;
 
-        
         /**
          * The next document id to return
          */
@@ -315,59 +310,58 @@ public class PredicateDerefQuery extends
          * @throws IOException
          */
         private void calculateChildren() throws IOException {
-            if (uuids == null) {
-                uuids = new ArrayList();
 //                subQueryHits.clear();
 //                hits.clear();
-                subQueryScorer.score(new HitCollector() {
-                    public void collect(int doc, float score) {
-                        subQueryHits.set(doc);
-                    }
-                });
+            subQueryScorer.score(new AbstractHitCollector() {
+                @Override
+                protected void collect(int doc, float score) {
+                    subQueryHits.set(doc);
+                }
+            });
 
-                TermDocs termDocs = reader.termDocs(new Term(FieldNames.PROPERTIES_SET, refProperty));
-                String prefix = FieldNames.createNamedValue(refProperty, "");
-                while (termDocs.next()) {
-                    int doc = termDocs.doc();
-                     
-                    String[] values = reader.document(doc).getValues(FieldNames.PROPERTIES);
-                    if (values == null) {
-                        // no reference properties at all on this node
-                        continue;
-                    }
-                    for (int v = 0; v < values.length; v++) {
-                        if (values[v].startsWith(prefix)) {
-                            String uuid = values[v].substring(prefix.length());
-                            
-                            TermDocs node = reader.termDocs(TermFactory.createUUIDTerm(uuid));
-                            try {
-                                while (node.next()) {
-                                    if (subQueryHits.get(node.doc())) {
-                                        hits.set(doc);
-                                    }
+            TermDocs termDocs = reader.termDocs(new Term(FieldNames.PROPERTIES_SET, refProperty));
+            String prefix = FieldNames.createNamedValue(refProperty, "");
+            while (termDocs.next()) {
+                int doc = termDocs.doc();
+
+                String[] values = reader.document(doc).getValues(FieldNames.PROPERTIES);
+                if (values == null) {
+                    // no reference properties at all on this node
+                    continue;
+                }
+                for (int v = 0; v < values.length; v++) {
+                    if (values[v].startsWith(prefix)) {
+                        String uuid = values[v].substring(prefix.length());
+
+                        TermDocs node = reader.termDocs(TermFactory.createUUIDTerm(uuid));
+                        try {
+                            while (node.next()) {
+                                if (subQueryHits.get(node.doc())) {
+                                    hits.set(doc);
                                 }
-                            } finally {
-                                node.close();
                             }
+                        } finally {
+                            node.close();
                         }
                     }
                 }
-                
-                // collect nameTest hits
-                final BitSet nameTestHits = new BitSet();
-                if (nameTestScorer != null) {
-                    nameTestScorer.score(new HitCollector() {
-                        public void collect(int doc, float score) {
-                            nameTestHits.set(doc);
-                        }
-                    });
-                }
+            }
 
-                // filter out the target nodes that do not match the name test
-                // if there is any name test at all.
-                if (nameTestScorer != null) {
-                    hits.and(nameTestHits);
-                }
+            // collect nameTest hits
+            final BitSet nameTestHits = new BitSet();
+            if (nameTestScorer != null) {
+                nameTestScorer.score(new AbstractHitCollector() {
+                    @Override
+                    protected void collect(int doc, float score) {
+                        nameTestHits.set(doc);
+                    }
+                });
+            }
+
+            // filter out the target nodes that do not match the name test
+            // if there is any name test at all.
+            if (nameTestScorer != null) {
+                hits.and(nameTestHits);
             }
         }
     }

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryHitsQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryHitsQuery.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryHitsQuery.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryHitsQuery.java Wed Jan 19 16:51:07 2011
@@ -39,6 +39,7 @@ import java.util.TreeSet;
  * <code>QueryHitsQuery</code> exposes a {@link QueryHits} implementation again
  * as a Lucene Query.
  */
+@SuppressWarnings("serial")
 public class QueryHitsQuery extends Query implements JackrabbitQuery{
 
     /**
@@ -58,7 +59,7 @@ public class QueryHitsQuery extends Quer
     /**
      * {@inheritDoc}
      */
-    protected Weight createWeight(Searcher searcher) throws IOException {
+    public Weight createWeight(Searcher searcher) throws IOException {
         return new QueryHitsQueryWeight(searcher.getSimilarity());
     }
 
@@ -96,7 +97,7 @@ public class QueryHitsQuery extends Quer
     /**
      * The Weight implementation for this query.
      */
-    public class QueryHitsQueryWeight implements Weight {
+    public class QueryHitsQueryWeight extends Weight {
 
         /**
          * The similarity.
@@ -142,7 +143,8 @@ public class QueryHitsQuery extends Quer
         /**
          * {@inheritDoc}
          */
-        public Scorer scorer(IndexReader reader) throws IOException {
+        public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder,
+                boolean topScorer) throws IOException {
             return new QueryHitsQueryScorer(reader, similarity);
         }
 
@@ -165,7 +167,7 @@ public class QueryHitsQuery extends Quer
          * Iterator over <code>Integer</code> instances identifying the
          * lucene documents. Document numbers are iterated in ascending order.
          */
-        private final Iterator docs;
+        private final Iterator<Integer> docs;
 
         /**
          * Maps <code>Integer</code> document numbers to <code>Float</code>
@@ -217,7 +219,7 @@ public class QueryHitsQuery extends Quer
          */
         public boolean next() throws IOException {
             if (docs.hasNext()) {
-                currentDoc = (Integer) docs.next();
+                currentDoc = docs.next();
                 return true;
             }
             return false;

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RangeQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RangeQuery.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RangeQuery.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RangeQuery.java Wed Jan 19 16:51:07 2011
@@ -34,6 +34,7 @@ import org.apache.lucene.search.Query;
 import org.apache.lucene.search.Scorer;
 import org.apache.lucene.search.Searcher;
 import org.apache.lucene.search.Similarity;
+import org.apache.lucene.search.TermRangeQuery;
 import org.apache.lucene.search.Weight;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -44,6 +45,7 @@ import org.slf4j.LoggerFactory;
  * but will calculate the matching documents itself. That way a
  * <code>TooManyClauses</code> can be avoided.
  */
+@SuppressWarnings("serial")
 public class RangeQuery extends Query implements Transformable {
 
     /**
@@ -147,7 +149,7 @@ public class RangeQuery extends Query im
     public Query rewrite(IndexReader reader) throws IOException {
         if (transform == TRANSFORM_NONE) {
             Query stdRangeQueryImpl
-                    = new org.apache.lucene.search.RangeQuery(lowerTerm, upperTerm, inclusive);
+                    = new TermRangeQuery(lowerTerm.field(), lowerTerm.text(), upperTerm.text(), inclusive, inclusive);
             try {
                 stdRangeQuery = stdRangeQueryImpl.rewrite(reader);
                 return stdRangeQuery;
@@ -169,7 +171,7 @@ public class RangeQuery extends Query im
      * @param searcher the searcher to use for the <code>Weight</code>.
      * @return the <code>Weigth</code> for this query.
      */
-    protected Weight createWeight(Searcher searcher) {
+    public Weight createWeight(Searcher searcher) {
         return new RangeQueryWeight(searcher, cache);
     }
 
@@ -238,7 +240,8 @@ public class RangeQuery extends Query im
          * @param reader index reader
          * @return a {@link RangeQueryScorer} instance
          */
-        protected Scorer createScorer(IndexReader reader) {
+        protected Scorer createScorer(IndexReader reader, boolean scoreDocsInOrder,
+                boolean topScorer) {
             return new RangeQueryScorer(searcher.getSimilarity(), reader, cache);
         }
 

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RefCountingIndexReader.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RefCountingIndexReader.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RefCountingIndexReader.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RefCountingIndexReader.java Wed Jan 19 16:51:07 2011
@@ -48,7 +48,7 @@ public class RefCountingIndexReader
     /**
      * @return the current reference count value.
      */
-    synchronized int getRefCount() {
+    public synchronized int getRefCount() {
         return refCount;
     }
 

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ScoreNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ScoreNode.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ScoreNode.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ScoreNode.java Wed Jan 19 16:51:07 2011
@@ -20,7 +20,6 @@ import java.io.IOException;
 
 import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.Term;
 import org.apache.lucene.index.TermDocs;
 
 /**

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SimilarityQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SimilarityQuery.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SimilarityQuery.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SimilarityQuery.java Wed Jan 19 16:51:07 2011
@@ -16,19 +16,19 @@
  */
 package org.apache.jackrabbit.core.query.lucene;
 
-import org.apache.lucene.search.Query;
-import org.apache.lucene.search.BooleanQuery;
+import java.io.IOException;
+
+import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.Term;
 import org.apache.lucene.index.TermDocs;
-import org.apache.lucene.analysis.Analyzer;
-
-import java.io.IOException;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.Query;
 
 /**
  * <code>SimilarityQuery</code> implements a query that returns similar nodes
  * for a given node UUID.
  */
+@SuppressWarnings("serial")
 public class SimilarityQuery extends Query {
 
     /**

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SimpleExcerptProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SimpleExcerptProvider.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SimpleExcerptProvider.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SimpleExcerptProvider.java Wed Jan 19 16:51:07 2011
@@ -60,9 +60,9 @@ public class SimpleExcerptProvider imple
         try {
             NodeState nodeState = (NodeState) ism.getItemState(id);
             String separator = "";
-            Iterator it = nodeState.getPropertyNames().iterator();
+            Iterator<Name> it = nodeState.getPropertyNames().iterator();
             while (it.hasNext() && text.length() < maxFragmentSize) {
-                PropertyId propId = new PropertyId(id, (Name) it.next());
+                PropertyId propId = new PropertyId(id, it.next());
                 PropertyState propState = (PropertyState) ism.getItemState(propId);
                 if (propState.getType() == PropertyType.STRING) {
                     text.append(separator);

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/TermDocsCache.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/TermDocsCache.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/TermDocsCache.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/TermDocsCache.java Wed Jan 19 16:51:07 2011
@@ -94,7 +94,7 @@ public class TermDocsCache {
      * @throws IOException if an error occurs while reading from the index.
      */
     public TermDocs termDocs(final Term t) throws IOException {
-        if (t.field() != field) {
+        if (t == null || t.field() != field) {
             return reader.termDocs(t);
         }
 
@@ -270,14 +270,13 @@ public class TermDocsCache {
         }
     }
 
-    private static final class CacheEntry implements Comparable {
+    private static final class CacheEntry implements Comparable<CacheEntry> {
 
         private volatile int numAccessed = 1;
 
         private volatile BitSet bits;
 
-        public int compareTo(Object o) {
-            CacheEntry other = (CacheEntry) o;
+        public int compareTo(CacheEntry other) {
             return (numAccessed < other.numAccessed ? -1 : (numAccessed == other.numAccessed ? 0 : 1));
         }
     }

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/VolatileIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/VolatileIndex.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/VolatileIndex.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/VolatileIndex.java Wed Jan 19 16:51:07 2011
@@ -39,7 +39,8 @@ class VolatileIndex extends AbstractInde
     /**
      * Map of pending documents to add to the index
      */
-    private final Map pending = new LinkedMap();
+    @SuppressWarnings("unchecked")
+    private final Map<String, Document> pending = new LinkedMap();
 
     /**
      * Number of documents that are buffered before they are added to the index.

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WeightedHighlighter.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WeightedHighlighter.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WeightedHighlighter.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WeightedHighlighter.java Wed Jan 19 16:51:07 2011
@@ -140,7 +140,7 @@ public class WeightedHighlighter extends
                         break;
                     }
                 }
-                bestFragments.insert(fi);
+                bestFragments.insertWithOverflow(fi);
             }
         }
 
@@ -189,7 +189,7 @@ public class WeightedHighlighter extends
             int limit = Math.max(0, fi.getStartOffset() / 2 + fi.getEndOffset() / 2 - surround);
             int len = startFragment(sb, text, fi.getStartOffset(), limit);
             TermVectorOffsetInfo lastOffsetInfo = null;
-            Iterator fIt = fi.iterator();
+            Iterator<TermVectorOffsetInfo> fIt = fi.iterator();
             while (fIt.hasNext()) {
                 TermVectorOffsetInfo oi = (TermVectorOffsetInfo) fIt.next();
                 if (lastOffsetInfo != null) {

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardNameQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardNameQuery.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardNameQuery.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardNameQuery.java Wed Jan 19 16:51:07 2011
@@ -16,18 +16,9 @@
  */
 package org.apache.jackrabbit.core.query.lucene;
 
-import java.io.IOException;
-
 import javax.jcr.NamespaceException;
 
-import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.Term;
-import org.apache.lucene.search.BooleanQuery;
-import org.apache.lucene.search.FilteredTermEnum;
-import org.apache.lucene.search.MultiTermQuery;
-import org.apache.lucene.search.Query;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardQuery.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardQuery.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardQuery.java Wed Jan 19 16:51:07 2011
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.core.query.lucene;
 
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.Term;
 import org.apache.lucene.index.TermEnum;
 import org.apache.lucene.index.TermDocs;
 import org.apache.lucene.search.FilteredTermEnum;
@@ -48,6 +47,7 @@ import java.util.Set;
  * <li><code>_</code> : matches exactly one character</li>
  * </ul>
  */
+@SuppressWarnings("serial")
 public class WildcardQuery extends Query implements Transformable {
 
     /**
@@ -141,7 +141,7 @@ public class WildcardQuery extends Query
      * @throws IOException if an error occurs while reading from the index.
      */
     public Query rewrite(IndexReader reader) throws IOException {
-        Query stdWildcardQuery = new MultiTermQuery(new Term(field, pattern)) {
+        Query stdWildcardQuery = new MultiTermQuery() {
             protected FilteredTermEnum getEnum(IndexReader reader) throws IOException {
                 return new WildcardTermEnum(reader, field, tvf, pattern, transform);
             }
@@ -162,7 +162,7 @@ public class WildcardQuery extends Query
      * @param searcher the searcher to use for the <code>Weight</code>.
      * @return the <code>Weigth</code> for this query.
      */
-    protected Weight createWeight(Searcher searcher) {
+    public Weight createWeight(Searcher searcher) {
         return new WildcardQueryWeight(searcher, cache);
     }
 
@@ -209,7 +209,8 @@ public class WildcardQuery extends Query
          * @param reader index reader
          * @return a {@link WildcardQueryScorer} instance
          */
-        protected Scorer createScorer(IndexReader reader) {
+        protected Scorer createScorer(IndexReader reader, boolean scoreDocsInOrder,
+                boolean topScorer) {
             return new WildcardQueryScorer(searcher.getSimilarity(), reader, cache);
         }
 

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/FSDirectoryManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/FSDirectoryManager.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/FSDirectoryManager.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/FSDirectoryManager.java Wed Jan 19 16:51:07 2011
@@ -141,7 +141,12 @@ public class FSDirectoryManager implemen
         private final FSDirectory directory;
 
         public FSDir(File dir) throws IOException {
-            directory = FSDirectory.getDirectory(dir,
+            if (!dir.mkdirs()) {
+                if (!dir.isDirectory()) {
+                    throw new IOException("Unable to create directory: '" + dir + "'");
+                }
+            }
+            directory = FSDirectory.open(dir,
                     new NativeFSLockFactory(dir));
         }
 
@@ -174,7 +179,7 @@ public class FSDirectoryManager implemen
         }
 
         public void renameFile(String from, String to) throws IOException {
-            directory.renameFile(from, to);
+            throw new UnsupportedOperationException("Not available in Lucene 3.0.x");
         }
 
         public long fileLength(String name) throws IOException {

Added: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/AbstractHitCollector.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/AbstractHitCollector.java?rev=1060863&view=auto
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/AbstractHitCollector.java (added)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/AbstractHitCollector.java Wed Jan 19 16:51:07 2011
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query.lucene.hits;
+
+import java.io.IOException;
+
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.search.Collector;
+import org.apache.lucene.search.Scorer;
+
+/**
+ * Collector implementation which simply provides the collection
+ * of re-based doc base with scorer.
+ */
+public abstract class AbstractHitCollector extends Collector {
+    protected int base = 0;
+    protected Scorer scorer = null;
+
+    @Override
+    public void setNextReader(IndexReader reader, int docBase) throws IOException {
+        base = docBase;
+    }
+
+    @Override
+    public void setScorer(Scorer scorer) throws IOException {
+        this.scorer = scorer;
+    }
+
+    @Override
+    public void collect(int doc) throws IOException {
+        collect(base + doc, scorer.score());
+    }
+
+    /**
+     * Called once for every document matching a query, with the re-based document
+     * number and its computed score.
+     * @param doc the re-based document number.
+     * @param doc the document's score.
+     */
+    protected abstract void collect(int doc, float score);
+
+    @Override
+    public boolean acceptsDocsOutOfOrder() {
+        return false;
+    }
+}

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/ScorerHits.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/ScorerHits.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/ScorerHits.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/ScorerHits.java Wed Jan 19 16:51:07 2011
@@ -18,6 +18,7 @@ package org.apache.jackrabbit.core.query
 
 import java.io.IOException;
 
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.Scorer;
 
 /**
@@ -42,8 +43,9 @@ public class ScorerHits implements Hits 
      * {@inheritDoc}
      */
     public int next() throws IOException {
-        if (scorer.next()) {
-            return scorer.doc();
+        int docId = scorer.nextDoc();
+        if (docId != DocIdSetIterator.NO_MORE_DOCS) {
+            return docId;
         } else {
             return -1;
         }
@@ -53,8 +55,9 @@ public class ScorerHits implements Hits 
      * {@inheritDoc}
      */
     public int skipTo(int target) throws IOException {
-        if (scorer.skipTo(target)) {
-            return scorer.doc();
+        int docId = scorer.advance(target);
+        if (docId != DocIdSetIterator.NO_MORE_DOCS) {
+            return docId;
         } else {
             return -1;
         }

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/SameNodeJoinMerger.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/SameNodeJoinMerger.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/SameNodeJoinMerger.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/SameNodeJoinMerger.java Wed Jan 19 16:51:07 2011
@@ -33,8 +33,6 @@ import javax.jcr.query.qom.PropertyValue
 import javax.jcr.query.qom.QueryObjectModelFactory;
 import javax.jcr.query.qom.SameNodeJoinCondition;
 
-import org.apache.jackrabbit.spi.commons.conversion.PathResolver;
-
 class SameNodeJoinMerger extends JoinMerger {
 
     private final String selector1;

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ScoreNodeMap.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ScoreNodeMap.java?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ScoreNodeMap.java (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ScoreNodeMap.java Wed Jan 19 16:51:07 2011
@@ -59,7 +59,9 @@ public final class ScoreNodeMap {
             existing = nodes;
             map.put(key, existing);
         } else if (existing instanceof List) {
-            ((List) existing).add(nodes);
+            @SuppressWarnings("unchecked")
+            List<ScoreNode[]> existingNodes = (List<ScoreNode[]>) existing;
+            existingNodes.add(nodes);
         } else {
             // ScoreNode[]
             List<ScoreNode[]> tmp = new ArrayList<ScoreNode[]>();
@@ -83,6 +85,7 @@ public final class ScoreNodeMap {
         if (sn == null) {
             return null;
         } else if (sn instanceof List) {
+            @SuppressWarnings("unchecked")
             List<ScoreNode[]> list = (List<ScoreNode[]>) sn;
             return list.toArray(new ScoreNode[list.size()][]);
         } else {

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-parent/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-parent/pom.xml?rev=1060863&r1=1060859&r2=1060863&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-parent/pom.xml (original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-parent/pom.xml Wed Jan 19 16:51:07 2011
@@ -257,7 +257,7 @@
       <dependency>
         <groupId>org.apache.lucene</groupId>
         <artifactId>lucene-core</artifactId>
-        <version>2.4.1</version>
+        <version>2.9.4</version>
       </dependency>
       <dependency>
         <groupId>org.apache.tika</groupId>



Mime
View raw message