lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r826778 - in /lucene/java/branches/lucene_2_9: CHANGES.txt src/java/org/apache/lucene/search/Hits.java
Date Mon, 19 Oct 2009 19:31:07 GMT
Author: markrmiller
Date: Mon Oct 19 19:31:06 2009
New Revision: 826778

URL: http://svn.apache.org/viewvc?rev=826778&view=rev
Log:
LUCENE-1955: Fix Hits deprecation notice to point users in right direction.

Modified:
    lucene/java/branches/lucene_2_9/CHANGES.txt
    lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/Hits.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=826778&r1=826777&r2=826778&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/CHANGES.txt (original)
+++ lucene/java/branches/lucene_2_9/CHANGES.txt Mon Oct 19 19:31:06 2009
@@ -31,6 +31,11 @@
 
  * LUCENE-1987: Un-deprecate some ctors of Token, as they will not
    be removed in 3.0 and are still useful.  (Uwe Schindler)
+   
+Documentation
+
+ * LUCENE-1955: Fix Hits deprecation notice to point users in right
+   direction. (Mike McCandless, Mark Miller)
 
  ======================= Release 2.9.0 2009-09-23 =======================
 

Modified: lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/Hits.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/Hits.java?rev=826778&r1=826777&r2=826778&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/Hits.java (original)
+++ lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/Hits.java Mon Oct 19
19:31:06 2009
@@ -40,15 +40,16 @@
  * (but <code>n</code> &lt; {@link #length()}_at_start). 
  * 
  * @deprecated
- * see {@link TopScoreDocCollector} and {@link TopDocs} :<br>
+ * see {@link Searcher#search(Query, int)}, {@link Searcher#search(Query, Filter, int)}
+ * and {@link Searcher#search(Query, Filter, int, Sort)}:<br>
  * <pre>
- *   TopScoreDocCollector collector = TopScoreDocCollector.create(hitsPerPage, false);
- *   searcher.search(new TermQuery(new Term("field", "iterator")), collector);
- *   ScoreDoc[] docHits = collector.topDocs().scoreDocs;
- *   for (int i = 0; i < docHits.length; i++) {
- *     int docId = docHits[i].doc;
+ *   TopDocs topDocs = searcher.search(query, numHits);
+ *   ScoreDoc[] hits = topDocs.scoreDocs;
+ *   for (int i = 0; i < hits.length; i++) {
+ *     int docId = hits[i].doc;
  *     Document d = searcher.doc(docId);
- *   }
+ *     // do something with current hit
+ *     ...
  * </pre>
  */
 public final class Hits {



Mime
View raw message