lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r691549 - /lucene/java/trunk/src/java/org/apache/lucene/search/Searcher.java
Date Wed, 03 Sep 2008 09:06:15 GMT
Author: mikemccand
Date: Wed Sep  3 02:06:13 2008
New Revision: 691549

URL: http://svn.apache.org/viewvc?rev=691549&view=rev
Log:
LUCENE-1371: add convenience method TopDocs Searcher.search(Query query, int n)

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/search/Searcher.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/Searcher.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/Searcher.java?rev=691549&r1=691548&r2=691549&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/Searcher.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/Searcher.java Wed Sep  3 02:06:13
2008
@@ -136,6 +136,16 @@
     return search(createWeight(query), filter, n);
   }
 
+  /** Finds the top <code>n</code>
+   * hits for <code>query</code>.
+   *
+   * @throws BooleanQuery.TooManyClauses
+   */
+  public TopDocs search(Query query, int n)
+    throws IOException {
+    return search(query, null, n);
+  }
+
   /** Returns an Explanation that describes how <code>doc</code> scored against
    * <code>query</code>.
    *



Mime
View raw message