lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpou...@apache.org
Subject svn commit: r1674100 [2/2] - in /lucene/dev/branches/branch_5x: ./ lucene/ lucene/core/ lucene/core/src/java/org/apache/lucene/search/ lucene/core/src/java/org/apache/lucene/search/payloads/ lucene/core/src/java/org/apache/lucene/search/spans/ lucene/c...
Date Thu, 16 Apr 2015 15:56:14 GMT
Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrConstantScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrConstantScoreQuery.java?rev=1674100&r1=1674099&r2=1674100&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrConstantScoreQuery.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrConstantScoreQuery.java
Thu Apr 16 15:56:13 2015
@@ -94,12 +94,6 @@ public class SolrConstantScoreQuery exte
     return this;
   }
 
-  @Override
-  public void extractTerms(Set terms) {
-    // OK to not add any terms when used for MultiSearcher,
-    // but may not be OK for highlighting
-  }
-
   protected class ConstantWeight extends Weight {
     private float queryNorm;
     private float queryWeight;
@@ -113,6 +107,12 @@ public class SolrConstantScoreQuery exte
     }
 
     @Override
+    public void extractTerms(Set<org.apache.lucene.index.Term> terms) {
+      // OK to not add any terms when used for MultiSearcher,
+      // but may not be OK for highlighting
+    }
+
+    @Override
     public float getValueForNormalization() throws IOException {
       queryWeight = getBoost();
       return queryWeight * queryWeight;

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/WrappedQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/WrappedQuery.java?rev=1674100&r1=1674099&r2=1674100&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/WrappedQuery.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/WrappedQuery.java
Thu Apr 16 15:56:13 2015
@@ -18,13 +18,11 @@
 package org.apache.solr.search;
 
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.Term;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.Weight;
 
 import java.io.IOException;
-import java.util.Set;
 
 /** A simple query that wraps another query and implements ExtendedQuery. */
 public class WrappedQuery extends ExtendedQueryBase {
@@ -64,11 +62,6 @@ public class WrappedQuery extends Extend
   }
 
   @Override
-  public void extractTerms(Set<Term> terms) {
-    q.extractTerms(terms);
-  }
-
-  @Override
   public WrappedQuery clone() {
     WrappedQuery newQ = (WrappedQuery)super.clone();
     newQ.q = (Query) q.clone();

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/join/IgnoreAcceptDocsQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/join/IgnoreAcceptDocsQuery.java?rev=1674100&r1=1674099&r2=1674100&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/join/IgnoreAcceptDocsQuery.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/join/IgnoreAcceptDocsQuery.java
Thu Apr 16 15:56:13 2015
@@ -62,6 +62,11 @@ public class IgnoreAcceptDocsQuery exten
     }
 
     @Override
+    public void extractTerms(Set<Term> terms) {
+      w.extractTerms(terms);
+    }
+
+    @Override
     public Explanation explain(LeafReaderContext context, int doc) throws IOException {
       return w.explain(context, doc);
     }
@@ -90,11 +95,6 @@ public class IgnoreAcceptDocsQuery exten
   }
 
   @Override
-  public void extractTerms(Set<Term> terms) {
-    q.extractTerms(terms);
-  }
-
-  @Override
   public int hashCode() {
     return q.hashCode()*31;
   }

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/stats/ExactStatsCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/stats/ExactStatsCache.java?rev=1674100&r1=1674099&r2=1674100&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/stats/ExactStatsCache.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/stats/ExactStatsCache.java
Thu Apr 16 15:56:13 2015
@@ -160,9 +160,8 @@ public class ExactStatsCache extends Sta
   public void returnLocalStats(ResponseBuilder rb, SolrIndexSearcher searcher) {
     Query q = rb.getQuery();
     try {
-      q = q.rewrite(searcher.getIndexReader());
       HashSet<Term> terms = new HashSet<Term>();
-      q.extractTerms(terms);
+      searcher.createNormalizedWeight(q, true).extractTerms(terms);
       IndexReaderContext context = searcher.getTopReaderContext();
       HashMap<String,TermStats> statsMap = new HashMap<String,TermStats>();
       HashMap<String,CollectionStats> colMap = new HashMap<String,CollectionStats>();

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/DeleteByQueryWrapper.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/DeleteByQueryWrapper.java?rev=1674100&r1=1674099&r2=1674100&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/DeleteByQueryWrapper.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/DeleteByQueryWrapper.java
Thu Apr 16 15:56:13 2015
@@ -18,10 +18,12 @@ package org.apache.solr.update;
  */
 
 import java.io.IOException;
+import java.util.Set;
 
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.LeafReader;
 import org.apache.lucene.index.LeafReaderContext;
+import org.apache.lucene.index.Term;
 import org.apache.lucene.search.Explanation;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Query;
@@ -70,6 +72,11 @@ final class DeleteByQueryWrapper extends
     final Weight inner = in.createWeight(privateContext, needsScores);
     return new Weight(DeleteByQueryWrapper.this) {
       @Override
+      public void extractTerms(Set<Term> terms) {
+        throw new UnsupportedOperationException();
+      }
+
+      @Override
       public Explanation explain(LeafReaderContext context, int doc) throws IOException {
throw new UnsupportedOperationException(); }
 
       @Override



Mime
View raw message