lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r778813 - in /lucene/java/trunk: CHANGES.txt src/java/org/apache/lucene/search/Scorer.java src/java/org/apache/lucene/search/TopScoreDocCollector.java
Date Tue, 26 May 2009 17:51:53 GMT
Author: mikemccand
Date: Tue May 26 17:51:52 2009
New Revision: 778813

URL: http://svn.apache.org/viewvc?rev=778813&view=rev
Log:
LUCENE-1575: clarify that certain float values are invalid scores

Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/src/java/org/apache/lucene/search/Scorer.java
    lucene/java/trunk/src/java/org/apache/lucene/search/TopScoreDocCollector.java

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=778813&r1=778812&r2=778813&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Tue May 26 17:51:52 2009
@@ -27,7 +27,11 @@
     implement Searchable or extend Searcher, you should change you
     code to implement this method.  If you already extend
     IndexSearcher, no further changes are needed to use Collector.
-    (Shai Erera via Mike McCandless)
+    
+    Finally, the values Float.Nan, Float.NEGATIVE_INFINITY and
+    Float.POSITIVE_INFINITY are not valid scores.  Lucene uses these
+    values internally in certain places, so if you have hits with such
+    scores it will cause problems. (Shai Erera via Mike McCandless)
 
 Changes in runtime behavior
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/Scorer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/Scorer.java?rev=778813&r1=778812&r2=778813&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/Scorer.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/Scorer.java Tue May 26 17:51:52 2009
@@ -31,6 +31,13 @@
  * Document scores are computed using a given <code>Similarity</code>
  * implementation.
  * </p>
+ *
+ * <p><b>NOTE</b>: The values Float.Nan,
+ * Float.NEGATIVE_INFINITY and Float.POSITIVE_INFINITY are
+ * not valid scores.  Certain collectors (eg {@link
+ * TopScoreDocCollector}) will not properly collect hits
+ * with these scores.
+ *
  * @see BooleanQuery#setAllowDocsOutOfOrder
  */
 public abstract class Scorer extends DocIdSetIterator {

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/TopScoreDocCollector.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/TopScoreDocCollector.java?rev=778813&r1=778812&r2=778813&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/TopScoreDocCollector.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/TopScoreDocCollector.java Tue May
26 17:51:52 2009
@@ -28,6 +28,11 @@
  * and then (when the scores are tied) docID ascending. When you create an
  * instance of this collector you should know in advance whether documents are
  * going to be collected in doc Id order or not.
+ *
+ * <p><b>NOTE</b>: The values Float.Nan,
+ * Float.NEGATIVE_INFINITY and Float.POSITIVE_INFINITY are
+ * not valid scores.  This collector will not properly
+ * collect hits with such scores.
  */
 public abstract class TopScoreDocCollector extends TopDocsCollector {
 



Mime
View raw message