The Searchable type exposes the following members.

Methods

  NameDescription
Public methodClose
Frees resources associated with this Searcher. Be careful not to call this method while you are still using objects like {@link Hits}.
Public methodDoc(Int32)
Expert: Returns the stored fields of document
CopyC#
i
. Called by {@link HitCollector} implementations.
Public methodDoc(Int32, FieldSelector)
Get the {@link Lucene.Net.Documents.Document} at the
CopyC#
n
th position. The {@link Lucene.Net.Documents.FieldSelector} may be used to determine what {@link Lucene.Net.Documents.Field}s to load and how they should be loaded. NOTE: If the underlying Reader (more specifically, the underlying
CopyC#
FieldsReader
) is closed before the lazy {@link Lucene.Net.Documents.Field} is loaded an exception may be thrown. If you want the value of a lazy {@link Lucene.Net.Documents.Field} to be available after closing you must explicitly load it or fetch the Document again with a new loader.
Public methodDocFreq
Expert: Returns the number of documents containing
CopyC#
term
. Called by search code to compute term weights.
Public methodDocFreqs
Expert: For each term in the terms array, calculates the number of documents containing
CopyC#
term
. Returns an array with these document frequencies. Used to minimize number of remote calls.
Public methodExplain
Expert: low-level implementation method Returns an Explanation that describes how
CopyC#
doc
scored against
CopyC#
weight
.

This is intended to be used in developing Similarity implementations, and, for good performance, should not be displayed with every hit. Computing an explanation is as expensive as executing the query over the entire index.

Applications should call {@link Searcher#Explain(Query, int)}.

Public methodMaxDoc
Expert: Returns one greater than the largest possible document number. Called by search code to compute term weights.
Public methodRewrite
Expert: called to re-write queries into primitive queries.
Public methodSearch(Weight, Filter, Collector)
Lower-level search API.

{@link Collector#Collect(int)} is called for every document.
Collector-based access to remote indexes is discouraged.

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.

Public methodSearch(Weight, Filter, HitCollector) Obsolete.
Lower-level search API.

{@link HitCollector#Collect(int,float)} is called for every non-zero scoring document.
HitCollector-based access to remote indexes is discouraged.

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.

Public methodSearch(Weight, Filter, Int32)
Expert: Low-level search implementation. Finds the top
CopyC#
n
hits for
CopyC#
query
, applying
CopyC#
filter
if non-null.

Called by {@link Hits}.

Applications should usually call {@link Searcher#Search(Query)} or {@link Searcher#Search(Query,Filter)} instead.

Public methodSearch(Weight, Filter, Int32, Sort)
Expert: Low-level search implementation with arbitrary sorting. Finds the top
CopyC#
n
hits for
CopyC#
query
, applying
CopyC#
filter
if non-null, and sorting the hits by the criteria in
CopyC#
sort
.

Applications should usually call {@link Searcher#Search(Query,Filter,int,Sort)} instead.

See Also