lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r781128 - in /lucene/java/branches/lucene_2_4_back_compat_tests/src: java/org/apache/lucene/search/IndexSearcher.java test/org/apache/lucene/search/TestMultiSearcher.java test/org/apache/lucene/search/TestSort.java
Date Tue, 02 Jun 2009 19:15:39 GMT
Author: mikemccand
Date: Tue Jun  2 19:15:39 2009
New Revision: 781128

URL: http://svn.apache.org/viewvc?rev=781128&view=rev
Log:
LUCENE-1656: don't compute scores by default when sorting by field

Modified:
    lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/IndexSearcher.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestMultiSearcher.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestSort.java

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/IndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/IndexSearcher.java?rev=781128&r1=781127&r2=781128&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/IndexSearcher.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/IndexSearcher.java
Tue Jun  2 19:15:39 2009
@@ -169,4 +169,8 @@
   public Explanation explain(Weight weight, int doc) throws IOException {
     return weight.explain(reader, doc);
   }
+
+  public void setDefaultFieldSortScoring(boolean doTrackScores, boolean doMaxScore) {
+    // stub so back compat compiles
+  }
 }

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestMultiSearcher.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestMultiSearcher.java?rev=781128&r1=781127&r2=781128&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestMultiSearcher.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestMultiSearcher.java
Tue Jun  2 19:15:39 2009
@@ -298,6 +298,7 @@
         initIndex(ramDirectory1, nDocs, false, "x"); // documents with two tokens "doc0"
and "x", "doc1" and x, etc...
         
         indexSearcher1=new IndexSearcher(ramDirectory1);
+        indexSearcher1.setDefaultFieldSortScoring(true, true);
         
         hits=indexSearcher1.search(query, null, 1000).scoreDocs;
         
@@ -325,7 +326,9 @@
         initIndex(ramDirectory2, nDocs, true, "x"); // documents with two tokens "doc0" and
"x", "doc1" and x, etc...
         
         indexSearcher1=new IndexSearcher(ramDirectory1);
+        indexSearcher1.setDefaultFieldSortScoring(true, true);
         indexSearcher2=new IndexSearcher(ramDirectory2);
+        indexSearcher2.setDefaultFieldSortScoring(true, true);
         
         Searcher searcher=getMultiSearcherInstance(new Searcher[] { indexSearcher1, indexSearcher2
});
         

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestSort.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestSort.java?rev=781128&r1=781127&r2=781128&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestSort.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestSort.java
Tue Jun  2 19:15:39 2009
@@ -140,7 +140,9 @@
 		}
 		writer.optimize ();
 		writer.close ();
-		return new IndexSearcher (indexStore);
+                IndexSearcher s = new IndexSearcher (indexStore);
+                s.setDefaultFieldSortScoring(true, true);
+                return s;
 	}
 
 	private Searcher getFullIndex()



Mime
View raw message