org.apache.lucene.search
public abstract class Searcher extends Object implements Searchable
| Method Summary | |
|---|---|
| Similarity | getSimilarity() Expert: Return the Similarity implementation used by this Searcher.
|
| Hits | search(Query query) Returns the documents matching query. |
| Hits | search(Query query, Filter filter) Returns the documents matching query and
filter. |
| Hits | search(Query query, Sort sort) Returns documents matching query sorted by
sort. |
| Hits | search(Query query, Filter filter, Sort sort) Returns documents matching query and filter,
sorted by sort. |
| void | search(Query query, HitCollector results) Lower-level search API.
|
| void | setSimilarity(Similarity similarity) Expert: Set the Similarity implementation used by this Searcher.
|
This defaults to the current value of {@link Similarity#getDefault()}.
query.query and
filter.query sorted by
sort.query and filter,
sorted by sort.{@link HitCollector#collect(int,float)} is called for every non-zero scoring document.
Applications should only use this if they need all of the matching documents. The high-level search API ({@link Searcher#search(Query)}) is usually more efficient, as it skips non-high-scoring hits.
Note: The score passed to this method is a raw score.
In other words, the score will not necessarily be a float whose value is
between 0 and 1.
See Also: setDefault