You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ro...@apache.org on 2014/12/08 16:37:49 UTC

svn commit: r1643843 - in /lucene/dev/branches/lucene2878/solr/core/src: java/org/apache/solr/handler/component/ java/org/apache/solr/schema/ java/org/apache/solr/search/ test/org/apache/solr/search/

Author: romseygeek
Date: Mon Dec  8 15:37:49 2014
New Revision: 1643843

URL: http://svn.apache.org/r1643843
Log:
LUCENE-2878: Get Solr compiling

Modified:
    lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java
    lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/schema/LatLonType.java
    lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java
    lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java
    lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/search/SolrConstantScoreQuery.java
    lucene/dev/branches/lucene2878/solr/core/src/test/org/apache/solr/search/TestRankQueryPlugin.java

Modified: lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java?rev=1643843&r1=1643842&r2=1643843&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java (original)
+++ lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java Mon Dec  8 15:37:49 2014
@@ -17,13 +17,20 @@
 
 package org.apache.solr.handler.component;
 
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import com.carrotsearch.hppc.IntObjectMap;
 import com.carrotsearch.hppc.IntObjectOpenHashMap;
 import com.carrotsearch.hppc.IntOpenHashSet;
 import com.carrotsearch.hppc.cursors.IntObjectCursor;
 import com.carrotsearch.hppc.cursors.ObjectCursor;
 import org.apache.lucene.index.DocValues;
-import org.apache.lucene.index.DocsEnum;
 import org.apache.lucene.index.LeafReader;
 import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.SortedDocValues;
@@ -61,14 +68,6 @@ import org.apache.solr.search.SolrIndexS
 import org.apache.solr.util.plugin.PluginInfoInitialized;
 import org.apache.solr.util.plugin.SolrCoreAware;
 
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 /**
  * The ExpandComponent is designed to work with the CollapsingPostFilter.
  * The CollapsingPostFilter collapses a result set on a field.
@@ -352,11 +351,6 @@ public class ExpandComponent extends Sea
       };
     }
 
-    @Override
-    public int postingFeatures() {
-      return DocsEnum.FLAG_NONE;
-    }
-
     public IntObjectMap<Collector> getGroups() {
       return groups;
     }

Modified: lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/schema/LatLonType.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/schema/LatLonType.java?rev=1643843&r1=1643842&r2=1643843&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/schema/LatLonType.java (original)
+++ lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/schema/LatLonType.java Mon Dec  8 15:37:49 2014
@@ -16,14 +16,20 @@ package org.apache.solr.schema;
  * limitations under the License.
  */
 
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 import com.spatial4j.core.context.SpatialContext;
 import com.spatial4j.core.distance.DistanceUtils;
 import com.spatial4j.core.shape.Point;
 import com.spatial4j.core.shape.Rectangle;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.index.DocsEnum;
-import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.StorableField;
 import org.apache.lucene.queries.function.FunctionValues;
 import org.apache.lucene.queries.function.ValueSource;
@@ -39,6 +45,7 @@ import org.apache.lucene.search.SortFiel
 import org.apache.lucene.search.Weight;
 import org.apache.lucene.uninverting.UninvertingReader.Type;
 import org.apache.lucene.util.Bits;
+import org.apache.lucene.util.BytesRef;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.response.TextResponseWriter;
 import org.apache.solr.search.DelegatingCollector;
@@ -48,12 +55,6 @@ import org.apache.solr.search.QParser;
 import org.apache.solr.search.SpatialOptions;
 import org.apache.solr.util.SpatialUtils;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 
 /**
  * Represents a Latitude/Longitude as a 2 dimensional point.  Latitude is <b>always</b> specified first.
@@ -483,10 +484,35 @@ class SpatialDistanceQuery extends Exten
 
     @Override
     public int nextPosition() throws IOException {
+      return NO_MORE_POSITIONS;
+    }
+
+    @Override
+    public int startPosition() throws IOException {
+      return NO_MORE_POSITIONS;
+    }
+
+    @Override
+    public int endPosition() throws IOException {
+      return NO_MORE_POSITIONS;
+    }
+
+    @Override
+    public int startOffset() throws IOException {
       return -1;
     }
 
     @Override
+    public int endOffset() throws IOException {
+      return -1;
+    }
+
+    @Override
+    public BytesRef getPayload() throws IOException {
+      return null;
+    }
+
+    @Override
     public long cost() {
       return maxDoc;
     }

Modified: lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java?rev=1643843&r1=1643842&r2=1643843&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java (original)
+++ lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java Mon Dec  8 15:37:49 2014
@@ -17,6 +17,11 @@
 
 package org.apache.solr.search;
 
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Map;
+
 import com.carrotsearch.hppc.FloatArrayList;
 import com.carrotsearch.hppc.IntIntOpenHashMap;
 import com.carrotsearch.hppc.IntOpenHashSet;
@@ -48,11 +53,6 @@ import org.apache.solr.schema.TrieFloatF
 import org.apache.solr.schema.TrieIntField;
 import org.apache.solr.schema.TrieLongField;
 
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Map;
-
 /**
 
  The <b>CollapsingQParserPlugin</b> is a PostFilter that performs field collapsing.
@@ -355,9 +355,34 @@ public class CollapsingQParserPlugin ext
 
     @Override
     public int nextPosition() throws IOException {
+      return NO_MORE_POSITIONS;
+    }
+
+    @Override
+    public int startPosition() throws IOException {
+      return NO_MORE_POSITIONS;
+    }
+
+    @Override
+    public int endPosition() throws IOException {
+      return NO_MORE_POSITIONS;
+    }
+
+    @Override
+    public int startOffset() throws IOException {
       return -1;
     }
 
+    @Override
+    public int endOffset() throws IOException {
+      return -1;
+    }
+
+    @Override
+    public BytesRef getPayload() throws IOException {
+      return null;
+    }
+
     public int advance(int i) {
       return -1;
     }

Modified: lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java?rev=1643843&r1=1643842&r2=1643843&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java (original)
+++ lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java Mon Dec  8 15:37:49 2014
@@ -16,6 +16,13 @@
  */
 package org.apache.solr.search;
 
+import java.io.Closeable;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+
 import org.apache.lucene.index.DocsEnum;
 import org.apache.lucene.index.Fields;
 import org.apache.lucene.index.IndexReader;
@@ -50,13 +57,6 @@ import org.apache.solr.request.SolrReque
 import org.apache.solr.schema.TrieField;
 import org.apache.solr.util.RefCounted;
 
-import java.io.Closeable;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-
 public class JoinQParserPlugin extends QParserPlugin {
   public static final String NAME = "join";
 
@@ -556,10 +556,35 @@ class JoinQuery extends Query {
 
     @Override
     public int nextPosition() throws IOException {
+      return NO_MORE_POSITIONS;
+    }
+
+    @Override
+    public int startPosition() throws IOException {
+      return NO_MORE_POSITIONS;
+    }
+
+    @Override
+    public int endPosition() throws IOException {
+      return NO_MORE_POSITIONS;
+    }
+
+    @Override
+    public int startOffset() throws IOException {
       return -1;
     }
 
     @Override
+    public int endOffset() throws IOException {
+      return -1;
+    }
+
+    @Override
+    public BytesRef getPayload() throws IOException {
+      return null;
+    }
+
+    @Override
     public int advance(int target) throws IOException {
       return iter.advance(target);
     }

Modified: lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/search/SolrConstantScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/search/SolrConstantScoreQuery.java?rev=1643843&r1=1643842&r2=1643843&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/search/SolrConstantScoreQuery.java (original)
+++ lucene/dev/branches/lucene2878/solr/core/src/java/org/apache/solr/search/SolrConstantScoreQuery.java Mon Dec  8 15:37:49 2014
@@ -1,5 +1,9 @@
 package org.apache.solr.search;
 
+import java.io.IOException;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.queries.function.ValueSource;
@@ -14,12 +18,9 @@ import org.apache.lucene.search.Query;
 import org.apache.lucene.search.Scorer;
 import org.apache.lucene.search.Weight;
 import org.apache.lucene.util.Bits;
+import org.apache.lucene.util.BytesRef;
 import org.apache.solr.common.SolrException;
 
-import java.io.IOException;
-import java.util.Map;
-import java.util.Set;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -202,10 +203,35 @@ public class SolrConstantScoreQuery exte
 
     @Override
     public int nextPosition() throws IOException {
+      return NO_MORE_POSITIONS;
+    }
+
+    @Override
+    public int startPosition() throws IOException {
+      return NO_MORE_POSITIONS;
+    }
+
+    @Override
+    public int endPosition() throws IOException {
+      return NO_MORE_POSITIONS;
+    }
+
+    @Override
+    public int startOffset() throws IOException {
+      return -1;
+    }
+
+    @Override
+    public int endOffset() throws IOException {
       return -1;
     }
 
     @Override
+    public BytesRef getPayload() throws IOException {
+      return null;
+    }
+
+    @Override
     public int advance(int target) throws IOException {
       return docIdSetIterator.advance(target);
     }

Modified: lucene/dev/branches/lucene2878/solr/core/src/test/org/apache/solr/search/TestRankQueryPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2878/solr/core/src/test/org/apache/solr/search/TestRankQueryPlugin.java?rev=1643843&r1=1643842&r2=1643843&view=diff
==============================================================================
--- lucene/dev/branches/lucene2878/solr/core/src/test/org/apache/solr/search/TestRankQueryPlugin.java (original)
+++ lucene/dev/branches/lucene2878/solr/core/src/test/org/apache/solr/search/TestRankQueryPlugin.java Mon Dec  8 15:37:49 2014
@@ -17,21 +17,33 @@
 
 package org.apache.solr.search;
 
-import org.apache.lucene.index.LeafReaderContext;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.lucene.index.DocValues;
 import org.apache.lucene.index.IndexReaderContext;
+import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.NumericDocValues;
 import org.apache.lucene.index.ReaderUtil;
 import org.apache.lucene.search.FieldComparator;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
 import org.apache.lucene.search.ScoreDoc;
+import org.apache.lucene.search.Scorer;
 import org.apache.lucene.search.Sort;
 import org.apache.lucene.search.SortField;
 import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.search.TopDocsCollector;
-import org.apache.lucene.search.Query;
 import org.apache.lucene.search.Weight;
-import org.apache.lucene.search.IndexSearcher;
-import org.apache.lucene.search.Scorer;
+import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.InPlaceMergeSorter;
 import org.apache.lucene.util.PriorityQueue;
 import org.apache.solr.client.solrj.SolrServerException;
@@ -46,25 +58,13 @@ import org.apache.solr.handler.component
 import org.apache.solr.handler.component.ShardDoc;
 import org.apache.solr.handler.component.ShardRequest;
 import org.apache.solr.handler.component.ShardResponse;
+import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.solr.schema.FieldType;
 import org.apache.solr.schema.IndexSchema;
 import org.apache.solr.schema.SchemaField;
-import org.apache.solr.request.SolrQueryRequest;
-
 import org.junit.Ignore;
 
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 
 @Ignore
 public class TestRankQueryPlugin extends QParserPlugin {
@@ -451,57 +451,88 @@ public class TestRankQueryPlugin extends
       }
     }
 
-   private class FakeScorer extends Scorer {
-        final int docid;
-        final float score;
-
-        FakeScorer(int docid, float score) {
-          super(null);
-          this.docid = docid;
-          this.score = score;
-        }
+    private class FakeScorer extends Scorer {
 
-        @Override
-        public int docID() {
-          return docid;
-        }
+      final int docid;
+      final float score;
 
-        @Override
-        public float score() throws IOException {
-          return score;
-        }
+      FakeScorer(int docid, float score) {
+        super(null);
+        this.docid = docid;
+        this.score = score;
+      }
 
-        @Override
-        public int freq() throws IOException {
-          throw new UnsupportedOperationException();
-        }
+      @Override
+      public int docID() {
+        return docid;
+      }
 
-        @Override
-        public int nextDoc() throws IOException {
-          throw new UnsupportedOperationException();
-        }
+      @Override
+      public float score() throws IOException {
+        return score;
+      }
 
-        @Override
-        public int advance(int target) throws IOException {
-          throw new UnsupportedOperationException();
-        }
+      @Override
+      public int freq() throws IOException {
+        throw new UnsupportedOperationException();
+      }
 
-        @Override
-        public long cost() {
-          return 1;
-        }
+      @Override
+      public int nextPosition() throws IOException {
+        return NO_MORE_POSITIONS;
+      }
 
-        @Override
-        public Weight getWeight() {
-          throw new UnsupportedOperationException();
-        }
+      @Override
+      public int startPosition() throws IOException {
+        return NO_MORE_POSITIONS;
+      }
 
-        @Override
-        public Collection<ChildScorer> getChildren() {
-          throw new UnsupportedOperationException();
-        }
+      @Override
+      public int endPosition() throws IOException {
+        return NO_MORE_POSITIONS;
+      }
+
+      @Override
+      public int startOffset() throws IOException {
+        return -1;
+      }
+
+      @Override
+      public int endOffset() throws IOException {
+        return -1;
+      }
+
+      @Override
+      public BytesRef getPayload() throws IOException {
+        return null;
+      }
+
+      @Override
+      public int nextDoc() throws IOException {
+        throw new UnsupportedOperationException();
       }
 
+      @Override
+      public int advance(int target) throws IOException {
+        throw new UnsupportedOperationException();
+      }
+
+      @Override
+      public long cost() {
+        return 1;
+      }
+
+      @Override
+      public Weight getWeight() {
+        throw new UnsupportedOperationException();
+      }
+
+      @Override
+      public Collection<ChildScorer> getChildren() {
+        throw new UnsupportedOperationException();
+      }
+    }
+
     public void merge(ResponseBuilder rb, ShardRequest sreq) {
 
       // id to shard mapping, to eliminate any accidental dups