lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romseyg...@apache.org
Subject svn commit: r1658373 [2/2] - in /lucene/dev/trunk: lucene/ lucene/core/src/java/org/apache/lucene/index/ lucene/core/src/java/org/apache/lucene/search/ lucene/core/src/java/org/apache/lucene/search/payloads/ lucene/core/src/java/org/apache/lucene/searc...
Date Mon, 09 Feb 2015 11:46:09 GMT
Modified: lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/FunctionQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/FunctionQuery.java?rev=1658373&r1=1658372&r2=1658373&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/FunctionQuery.java
(original)
+++ lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/FunctionQuery.java
Mon Feb  9 11:46:07 2015
@@ -204,7 +204,7 @@ public class FunctionQuery extends Query
 
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException
{
+  public Weight createWeight(IndexSearcher searcher, int postingsFlags) throws IOException
{
     return new FunctionQuery.FunctionWeight(searcher);
   }
 

Modified: lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/QueryValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/QueryValueSource.java?rev=1658373&r1=1658372&r2=1658373&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/QueryValueSource.java
(original)
+++ lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/QueryValueSource.java
Mon Feb  9 11:46:07 2015
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.util.Map;
 
 import org.apache.lucene.index.LeafReaderContext;
+import org.apache.lucene.index.PostingsEnum;
 import org.apache.lucene.index.ReaderUtil;
 import org.apache.lucene.queries.function.FunctionValues;
 import org.apache.lucene.queries.function.ValueSource;
@@ -72,7 +73,7 @@ public class QueryValueSource extends Va
 
   @Override
   public void createWeight(Map context, IndexSearcher searcher) throws IOException {
-    Weight w = searcher.createNormalizedWeight(q, true);
+    Weight w = searcher.createNormalizedWeight(q, PostingsEnum.FLAG_FREQS);
     context.put(this, w);
   }
 }

Modified: lucene/dev/trunk/lucene/sandbox/src/java/org/apache/lucene/search/TermAutomatonQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/sandbox/src/java/org/apache/lucene/search/TermAutomatonQuery.java?rev=1658373&r1=1658372&r2=1658373&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/sandbox/src/java/org/apache/lucene/search/TermAutomatonQuery.java
(original)
+++ lucene/dev/trunk/lucene/sandbox/src/java/org/apache/lucene/search/TermAutomatonQuery.java
Mon Feb  9 11:46:07 2015
@@ -188,7 +188,7 @@ public class TermAutomatonQuery extends
   }
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException
{
+  public Weight createWeight(IndexSearcher searcher, int postingsFlags) throws IOException
{
     IndexReaderContext context = searcher.getTopReaderContext();
     Map<Integer,TermContext> termStates = new HashMap<>();
 

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/AssertingIndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/AssertingIndexSearcher.java?rev=1658373&r1=1658372&r2=1658373&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/AssertingIndexSearcher.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/AssertingIndexSearcher.java
Mon Feb  9 11:46:07 2015
@@ -56,8 +56,8 @@ public class AssertingIndexSearcher exte
   
   /** Ensures, that the returned {@code Weight} is not normalized again, which may produce
wrong scores. */
   @Override
-  public Weight createNormalizedWeight(Query query, boolean needsScores) throws IOException
{
-    final Weight w = super.createNormalizedWeight(query, needsScores);
+  public Weight createNormalizedWeight(Query query, int postingsFlags) throws IOException
{
+    final Weight w = super.createNormalizedWeight(query, postingsFlags);
     return new AssertingWeight(random, w) {
 
       @Override

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/AssertingQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/AssertingQuery.java?rev=1658373&r1=1658372&r2=1658373&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/AssertingQuery.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/AssertingQuery.java
Mon Feb  9 11:46:07 2015
@@ -42,8 +42,8 @@ public class AssertingQuery extends Quer
   }
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException
{
-    return AssertingWeight.wrap(new Random(random.nextLong()), in.createWeight(searcher,
needsScores));
+  public Weight createWeight(IndexSearcher searcher, int postingsFlags) throws IOException
{
+    return AssertingWeight.wrap(new Random(random.nextLong()), in.createWeight(searcher,
postingsFlags));
   }
 
   @Override

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java?rev=1658373&r1=1658372&r2=1658373&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java
Mon Feb  9 11:46:07 2015
@@ -32,6 +32,7 @@ import org.apache.lucene.index.IndexWrit
 import org.apache.lucene.index.LeafReader;
 import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.MultiReader;
+import org.apache.lucene.index.PostingsEnum;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.MockDirectoryWrapper;
 import org.apache.lucene.store.RAMDirectory;
@@ -261,7 +262,7 @@ public class QueryUtils {
             lastDoc[0] = doc;
             try {
               if (scorer == null) {
-                Weight w = s.createNormalizedWeight(q, true);
+                Weight w = s.createNormalizedWeight(q, PostingsEnum.FLAG_FREQS);
                 LeafReaderContext context = readerContextArray.get(leafPtr);
                 scorer = w.scorer(context, context.reader().getLiveDocs());
               }
@@ -313,7 +314,7 @@ public class QueryUtils {
               final LeafReader previousReader = lastReader[0];
               IndexSearcher indexSearcher = LuceneTestCase.newSearcher(previousReader);
               indexSearcher.setSimilarity(s.getSimilarity());
-              Weight w = indexSearcher.createNormalizedWeight(q, true);
+              Weight w = indexSearcher.createNormalizedWeight(q, PostingsEnum.FLAG_FREQS);
               LeafReaderContext ctx = (LeafReaderContext)indexSearcher.getTopReaderContext();
               Scorer scorer = w.scorer(ctx, ctx.reader().getLiveDocs());
               if (scorer != null) {
@@ -335,7 +336,7 @@ public class QueryUtils {
           final LeafReader previousReader = lastReader[0];
           IndexSearcher indexSearcher = LuceneTestCase.newSearcher(previousReader, false);
           indexSearcher.setSimilarity(s.getSimilarity());
-          Weight w = indexSearcher.createNormalizedWeight(q, true);
+          Weight w = indexSearcher.createNormalizedWeight(q, PostingsEnum.FLAG_FREQS);
           LeafReaderContext ctx = previousReader.getContext();
           Scorer scorer = w.scorer(ctx, ctx.reader().getLiveDocs());
           if (scorer != null) {
@@ -367,7 +368,7 @@ public class QueryUtils {
         try {
           long startMS = System.currentTimeMillis();
           for (int i=lastDoc[0]+1; i<=doc; i++) {
-            Weight w = s.createNormalizedWeight(q, true);
+            Weight w = s.createNormalizedWeight(q, PostingsEnum.FLAG_FREQS);
             Scorer scorer = w.scorer(context.get(leafPtr), liveDocs);
             Assert.assertTrue("query collected "+doc+" but skipTo("+i+") says no more docs!",scorer.advance(i)
!= DocIdSetIterator.NO_MORE_DOCS);
             Assert.assertEquals("query collected "+doc+" but skipTo("+i+") got to "+scorer.docID(),doc,scorer.docID());
@@ -400,7 +401,7 @@ public class QueryUtils {
           final LeafReader previousReader = lastReader[0];
           IndexSearcher indexSearcher = LuceneTestCase.newSearcher(previousReader);
           indexSearcher.setSimilarity(s.getSimilarity());
-          Weight w = indexSearcher.createNormalizedWeight(q, true);
+          Weight w = indexSearcher.createNormalizedWeight(q, PostingsEnum.FLAG_FREQS);
           Scorer scorer = w.scorer((LeafReaderContext)indexSearcher.getTopReaderContext(),
previousReader.getLiveDocs());
           if (scorer != null) {
             boolean more = scorer.advance(lastDoc[0] + 1) != DocIdSetIterator.NO_MORE_DOCS;
@@ -421,7 +422,7 @@ public class QueryUtils {
       final LeafReader previousReader = lastReader[0];
       IndexSearcher indexSearcher = LuceneTestCase.newSearcher(previousReader);
       indexSearcher.setSimilarity(s.getSimilarity());
-      Weight w = indexSearcher.createNormalizedWeight(q, true);
+      Weight w = indexSearcher.createNormalizedWeight(q, PostingsEnum.FLAG_FREQS);
       Scorer scorer = w.scorer((LeafReaderContext)indexSearcher.getTopReaderContext(), previousReader.getLiveDocs());
       if (scorer != null) {
         boolean more = scorer.advance(lastDoc[0] + 1) != DocIdSetIterator.NO_MORE_DOCS;
@@ -432,7 +433,7 @@ public class QueryUtils {
 
   /** Check that the scorer and bulk scorer advance consistently. */
   public static void checkBulkScorerSkipTo(Random r, Query query, IndexSearcher searcher)
throws IOException {
-    Weight weight = searcher.createNormalizedWeight(query, true);
+    Weight weight = searcher.createNormalizedWeight(query, PostingsEnum.FLAG_FREQS);
     for (LeafReaderContext context : searcher.getIndexReader().leaves()) {
       final Scorer scorer = weight.scorer(context, context.reader().getLiveDocs());
       final BulkScorer bulkScorer = weight.bulkScorer(context, context.reader().getLiveDocs());

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/LatLonType.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/LatLonType.java?rev=1658373&r1=1658372&r2=1658373&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/LatLonType.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/LatLonType.java Mon Feb  9
11:46:07 2015
@@ -563,7 +563,7 @@ class SpatialDistanceQuery extends Exten
 
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException
{
+  public Weight createWeight(IndexSearcher searcher, int postingsFlags) throws IOException
{
     // if we were supposed to use bboxQuery, then we should have been rewritten using that
query
     assert bboxQuery == null;
     return new SpatialWeight(searcher);

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/ExportQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/ExportQParserPlugin.java?rev=1658373&r1=1658372&r2=1658373&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/ExportQParserPlugin.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/ExportQParserPlugin.java Mon
Feb  9 11:46:07 2015
@@ -80,7 +80,7 @@ public class ExportQParserPlugin extends
     }
 
     public Weight createWeight(IndexSearcher searcher) throws IOException {
-      return mainQuery.createWeight(searcher, true);
+      return mainQuery.createWeight(searcher, PostingsEnum.FLAG_FREQS);
     }
 
     public Query rewrite(IndexReader reader) throws IOException {

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java?rev=1658373&r1=1658372&r2=1658373&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java Mon
Feb  9 11:46:07 2015
@@ -210,7 +210,7 @@ class JoinQuery extends Query {
   }
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException
{
+  public Weight createWeight(IndexSearcher searcher, int postingsFlags) throws IOException
{
     return new JoinQueryWeight((SolrIndexSearcher)searcher);
   }
 

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java?rev=1658373&r1=1658372&r2=1658373&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java Mon
Feb  9 11:46:07 2015
@@ -27,6 +27,7 @@ import com.carrotsearch.hppc.IntFloatOpe
 import com.carrotsearch.hppc.IntIntOpenHashMap;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.LeafReaderContext;
+import org.apache.lucene.index.PostingsEnum;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.Explanation;
 import org.apache.lucene.search.IndexSearcher;
@@ -171,8 +172,9 @@ public class ReRankQParserPlugin extends
 
     }
 
-    public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException{
-      return new ReRankWeight(mainQuery, reRankQuery, reRankWeight, searcher, needsScores);
+    @Override
+    public Weight createWeight(IndexSearcher searcher, int postingsFlags) throws IOException{
+      return new ReRankWeight(mainQuery, reRankQuery, reRankWeight, searcher, postingsFlags);
     }
   }
 
@@ -182,12 +184,12 @@ public class ReRankQParserPlugin extends
     private Weight mainWeight;
     private double reRankWeight;
 
-    public ReRankWeight(Query mainQuery, Query reRankQuery, double reRankWeight, IndexSearcher
searcher, boolean needsScores) throws IOException {
+    public ReRankWeight(Query mainQuery, Query reRankQuery, double reRankWeight, IndexSearcher
searcher, int postingsFlags) throws IOException {
       super(mainQuery);
       this.reRankQuery = reRankQuery;
       this.searcher = searcher;
       this.reRankWeight = reRankWeight;
-      this.mainWeight = mainQuery.createWeight(searcher, needsScores);
+      this.mainWeight = mainQuery.createWeight(searcher, postingsFlags);
     }
 
     public float getValueForNormalization() throws IOException {

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrConstantScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrConstantScoreQuery.java?rev=1658373&r1=1658372&r2=1658373&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrConstantScoreQuery.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrConstantScoreQuery.java
Mon Feb  9 11:46:07 2015
@@ -229,7 +229,7 @@ public class SolrConstantScoreQuery exte
   }
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) {
+  public Weight createWeight(IndexSearcher searcher, int postingsFlags) {
     try {
       return new SolrConstantScoreQuery.ConstantWeight(searcher);
     } catch (IOException e) {

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java?rev=1658373&r1=1658372&r2=1658373&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java Mon
Feb  9 11:46:07 2015
@@ -1113,7 +1113,7 @@ public class SolrIndexSearcher extends I
       List<Weight> weights = new ArrayList<>(notCached.size());
       for (Query q : notCached) {
         Query qq = QueryUtils.makeQueryable(q);
-        weights.add(createNormalizedWeight(qq, true));
+        weights.add(createNormalizedWeight(qq, PostingsEnum.FLAG_FREQS));
       }
       pf.filter = new FilterImpl(answer, weights);
     } else {

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/WrappedQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/WrappedQuery.java?rev=1658373&r1=1658372&r2=1658373&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/WrappedQuery.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/WrappedQuery.java Mon Feb 
9 11:46:07 2015
@@ -53,8 +53,8 @@ public class WrappedQuery extends Extend
   }
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException
{
-    return q.createWeight(searcher, needsScores);
+  public Weight createWeight(IndexSearcher searcher, int postingsFlags) throws IOException
{
+    return q.createWeight(searcher, postingsFlags);
   }
 
   @Override

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/join/IgnoreAcceptDocsQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/join/IgnoreAcceptDocsQuery.java?rev=1658373&r1=1658372&r2=1658373&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/join/IgnoreAcceptDocsQuery.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/join/IgnoreAcceptDocsQuery.java
Mon Feb  9 11:46:07 2015
@@ -53,8 +53,8 @@ public class IgnoreAcceptDocsQuery exten
   }
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException
{
-    Weight inner = q.createWeight(searcher, needsScores);
+  public Weight createWeight(IndexSearcher searcher, int postingsFlags) throws IOException
{
+    Weight inner = q.createWeight(searcher, postingsFlags);
     return new IADWeight(inner);
   }
 

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DeleteByQueryWrapper.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DeleteByQueryWrapper.java?rev=1658373&r1=1658372&r2=1658373&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DeleteByQueryWrapper.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DeleteByQueryWrapper.java Mon
Feb  9 11:46:07 2015
@@ -64,10 +64,10 @@ final class DeleteByQueryWrapper extends
   }
   
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException
{
+  public Weight createWeight(IndexSearcher searcher, int postingsFlags) throws IOException
{
     final LeafReader wrapped = wrap((LeafReader) searcher.getIndexReader());
     final IndexSearcher privateContext = new IndexSearcher(wrapped);
-    final Weight inner = in.createWeight(privateContext, needsScores);
+    final Weight inner = in.createWeight(privateContext, postingsFlags);
     return new Weight(DeleteByQueryWrapper.this) {
       @Override
       public Explanation explain(LeafReaderContext context, int doc) throws IOException {
throw new UnsupportedOperationException(); }

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestRankQueryPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestRankQueryPlugin.java?rev=1658373&r1=1658372&r2=1658373&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestRankQueryPlugin.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestRankQueryPlugin.java Mon
Feb  9 11:46:07 2015
@@ -32,6 +32,7 @@ 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.PostingsEnum;
 import org.apache.lucene.index.ReaderUtil;
 import org.apache.lucene.search.FieldComparator;
 import org.apache.lucene.search.IndexSearcher;
@@ -114,8 +115,9 @@ public class TestRankQueryPlugin extends
       return false;
     }
 
-    public Weight createWeight(IndexSearcher indexSearcher, boolean needsScores) throws IOException{
-      return q.createWeight(indexSearcher, needsScores);
+    @Override
+    public Weight createWeight(IndexSearcher indexSearcher, int postingsFlags) throws IOException{
+      return q.createWeight(indexSearcher, postingsFlags);
     }
 
     public void setBoost(float boost) {



Mime
View raw message