mirror of https://github.com/apache/lucene.git
add search method that allows Sort, but doesn't require a Filter
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1021360 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8887a044ea
commit
98b20d6479
|
@ -49,6 +49,19 @@ public abstract class Searcher implements Searchable {
|
|||
return search(createWeight(query), filter, n, sort);
|
||||
}
|
||||
|
||||
/**
|
||||
* Search implementation with arbitrary sorting and no filter.
|
||||
* @param query The query to search for
|
||||
* @param n Return only the top n results
|
||||
* @param sort The {@link org.apache.lucene.search.Sort} object
|
||||
* @return The top docs, sorted according to the supplied {@link org.apache.lucene.search.Sort} instance
|
||||
* @throws IOException
|
||||
*/
|
||||
public TopFieldDocs search(Query query, int n,
|
||||
Sort sort) throws IOException {
|
||||
return search(createWeight(query), null, n, sort);
|
||||
}
|
||||
|
||||
/** Lower-level search API.
|
||||
*
|
||||
* <p>{@link Collector#collect(int)} is called for every matching document.
|
||||
|
|
Loading…
Reference in New Issue