lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r829881 - in /lucene/java/branches/lucene_2_9: CHANGES.txt src/java/org/apache/lucene/search/IndexSearcher.java src/java/org/apache/lucene/search/Searchable.java src/java/org/apache/lucene/search/Searcher.java
Date Mon, 26 Oct 2009 17:58:08 GMT
Author: mikemccand
Date: Mon Oct 26 17:58:07 2009
New Revision: 829881

URL: http://svn.apache.org/viewvc?rev=829881&view=rev
Log:
LUCENE-1973: un-deprecate IndexSearcher.setDefaultFieldSortScoring

Modified:
    lucene/java/branches/lucene_2_9/CHANGES.txt
    lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/IndexSearcher.java
    lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/Searchable.java
    lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/Searcher.java

Modified: lucene/java/branches/lucene_2_9/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9/CHANGES.txt?rev=829881&r1=829880&r2=829881&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/CHANGES.txt (original)
+++ lucene/java/branches/lucene_2_9/CHANGES.txt Mon Oct 26 17:58:07 2009
@@ -48,6 +48,10 @@
    o.a.l.util.Version constants for enabling invalid acronym
    settings in StandardAnalyzer to be compatible with the coming
    Lucene 3.0.  (Uwe Schindler)
+
+ * LUCENE-1973: Un-deprecate IndexSearcher.setDefaultFieldSortScoring,
+   to allow controlling per-IndexSearcher whether scores are computed
+   when sorting by field.  (Uwe Schindler, Mike McCandless)
    
 Documentation
 

Modified: lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/IndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/IndexSearcher.java?rev=829881&r1=829880&r2=829881&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/IndexSearcher.java (original)
+++ lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/IndexSearcher.java Mon
Oct 26 17:58:07 2009
@@ -321,7 +321,18 @@
   private boolean fieldSortDoTrackScores;
   private boolean fieldSortDoMaxScore;
 
-  /** @deprecated */
+  /** By default, no scores are computed when sorting by
+   *  field (using {@link #search(Query,Filter,int,Sort)}).
+   *  You can change that, per IndexSearcher instance, by
+   *  calling this method.  Note that this will incur a CPU
+   *  cost.
+   * 
+   *  @param doTrackScores If true, then scores are
+   *  returned for every matching document in {@link
+   *  TopFieldDocs}.
+   *
+   *  @param doMaxScore If true, then the max score for all
+   *  matching docs is computed. */
   public void setDefaultFieldSortScoring(boolean doTrackScores, boolean doMaxScore) {
     fieldSortDoTrackScores = doTrackScores;
     fieldSortDoMaxScore = doMaxScore;

Modified: lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/Searchable.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/Searchable.java?rev=829881&r1=829880&r2=829881&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/Searchable.java (original)
+++ lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/Searchable.java Mon
Oct 26 17:58:07 2009
@@ -174,7 +174,7 @@
    * <code>sort</code>.
    *
    * <p>Applications should usually call {@link
-   * Searcher#search(Query,Filter,Sort)} instead.
+   * Searcher#search(Query,Filter,int,Sort)} instead.
    * 
    * @throws BooleanQuery.TooManyClauses
    */

Modified: lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/Searcher.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/Searcher.java?rev=829881&r1=829880&r2=829881&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/Searcher.java (original)
+++ lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/Searcher.java Mon Oct
26 17:58:07 2009
@@ -79,11 +79,9 @@
    * <code>filter</code> if non-null, and sorting the hits by the criteria in
    * <code>sort</code>.
    * 
-   * <p>NOTE: this does not compute scores by default.  If
-   * you need scores, create a {@link TopFieldCollector}
-   * instance by calling {@link TopFieldCollector#create}
-   * and then pass that to {@link #search(Query, Filter,
-   * Collector)}.</p>
+   * <p>NOTE: this does not compute scores by default; use
+   * {@link IndexSearcher#setDefaultFieldSortScoring} to
+   * enable scoring.
    *
    * @throws BooleanQuery.TooManyClauses
    */



Mime
View raw message