diff --git a/src/java/org/apache/lucene/search/Searcher.java b/src/java/org/apache/lucene/search/Searcher.java index a70615561b3..b6b327dc4ba 100644 --- a/src/java/org/apache/lucene/search/Searcher.java +++ b/src/java/org/apache/lucene/search/Searcher.java @@ -136,6 +136,16 @@ public abstract class Searcher implements Searchable { return search(createWeight(query), filter, n); } + /** Finds the top n + * hits for query. + * + * @throws BooleanQuery.TooManyClauses + */ + public TopDocs search(Query query, int n) + throws IOException { + return search(query, null, n); + } + /** Returns an Explanation that describes how doc scored against * query. *