Lucene.Net
3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
|
The interface for search implementations. More...
Inherits IDisposable.
Inherited by Lucene.Net.Search.Searcher.
Public Member Functions | |
void | Search (Weight weight, Filter filter, Collector collector) |
Lower-level search API. | |
void | Close () |
Frees resources associated with this Searcher. Be careful not to call this method while you are still using objects that reference this searchable | |
int | DocFreq (Term term) |
Expert: Returns the number of documents containing term . Called by search code to compute term weights. | |
int[] | DocFreqs (Term[] terms) |
Expert: For each term in the terms array, calculates the number of documents containing term . Returns an array with these document frequencies. Used to minimize number of remote calls. | |
TopDocs | Search (Weight weight, Filter filter, int n) |
Expert: Low-level search implementation. Finds the top n hits for query , applying filter if non-null. | |
Document | Doc (int i) |
Expert: Returns the stored fields of document i . | |
Document | Doc (int n, FieldSelector fieldSelector) |
Get the Lucene.Net.Documents.Documentat the n th position. The Lucene.Net.Documents.FieldSelector may be used to determine what Lucene.Net.Documents.Fields to load and how they should be loaded. | |
Query | Rewrite (Query query) |
Expert: called to re-write queries into primitive queries. | |
Explanation | Explain (Weight weight, int doc) |
Expert: low-level implementation method Returns an Explanation that describes how doc scored against weight . | |
TopFieldDocs | Search (Weight weight, Filter filter, int n, Sort sort) |
Expert: Low-level search implementation with arbitrary sorting. Finds the top n hits for query , applying filter if non-null, and sorting the hits by the criteria in sort . | |
Properties | |
int | MaxDoc [get] |
Expert: Returns one greater than the largest possible document number. Called by search code to compute term weights. | |
The interface for search implementations.
Searchable is the abstract network protocol for searching. Implementations provide search over a single index, over multiple indices, and over indices on remote servers.
Queries, filters and sort criteria are designed to be compact so that they may be efficiently passed to a remote index, with only the top-scoring hits being returned, rather than every matching hit.
NOTE: this interface is kept public for convenience. Since it is not expected to be implemented directly, it may be changed unexpectedly between releases.
Definition at line 44 of file Searchable.cs.
void Lucene.Net.Search.Searchable.Close | ( | ) |
Frees resources associated with this Searcher. Be careful not to call this method while you are still using objects that reference this searchable
Implemented in Lucene.Net.Search.Searcher.
Document Lucene.Net.Search.Searchable.Doc | ( | int | i | ) |
Expert: Returns the stored fields of document i
.
<throws> CorruptIndexException if the index is corrupt </throws> <throws> IOException if there is a low-level IO error </throws>
Implemented in Lucene.Net.Search.MultiSearcher, Lucene.Net.Search.Searcher, and Lucene.Net.Search.IndexSearcher.
Document Lucene.Net.Search.Searchable.Doc | ( | int | n, |
FieldSelector | fieldSelector | ||
) |
Get the Lucene.Net.Documents.Documentat the n
th position. The Lucene.Net.Documents.FieldSelector may be used to determine what Lucene.Net.Documents.Fields to load and how they should be loaded.
NOTE: If the underlying Reader (more specifically, the underlying FieldsReader
) is closed before the lazy Lucene.Net.Documents.Field is loaded an exception may be thrown. If you want the value of a lazy Lucene.Net.Documents.Field to be available after closing you must explicitly load it or fetch the Document again with a new loader.
n | Get the document at the n th position |
fieldSelector | The Lucene.Net.Documents.FieldSelector to use to determine what Fields should be loaded on the Document. May be null, in which case all Fields will be loaded. |
<throws> CorruptIndexException if the index is corrupt </throws> <throws> IOException if there is a low-level IO error </throws>
Implemented in Lucene.Net.Search.MultiSearcher, Lucene.Net.Search.Searcher, and Lucene.Net.Search.IndexSearcher.
int Lucene.Net.Search.Searchable.DocFreq | ( | Term | term | ) |
Expert: Returns the number of documents containing term
. Called by search code to compute term weights.
Implemented in Lucene.Net.Search.MultiSearcher, Lucene.Net.Search.Searcher, Lucene.Net.Search.IndexSearcher, and Lucene.Net.Search.ParallelMultiSearcher.
int [] Lucene.Net.Search.Searchable.DocFreqs | ( | Term[] | terms | ) |
Expert: For each term in the terms array, calculates the number of documents containing term
. Returns an array with these document frequencies. Used to minimize number of remote calls.
Implemented in Lucene.Net.Search.Searcher.
Explanation Lucene.Net.Search.Searchable.Explain | ( | Weight | weight, |
int | doc | ||
) |
Expert: low-level implementation method Returns an Explanation that describes how doc
scored against 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 Searcher.Explain(Query, int).
<throws> BooleanQuery.TooManyClauses </throws>
Implemented in Lucene.Net.Search.MultiSearcher, Lucene.Net.Search.IndexSearcher, and Lucene.Net.Search.Searcher.
Expert: called to re-write queries into primitive queries.
<throws> BooleanQuery.TooManyClauses </throws>
Implemented in Lucene.Net.Search.MultiSearcher, Lucene.Net.Search.IndexSearcher, and Lucene.Net.Search.Searcher.
Lower-level search API.
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 (Searcher.Search(Query,int)) is usually more efficient, as it skips non-high-scoring hits.
weight | to match documents |
filter | if non-null, used to permit documents to be collected. |
collector | to receive hits |
<throws> BooleanQuery.TooManyClauses </throws>
Implemented in Lucene.Net.Search.MultiSearcher, Lucene.Net.Search.IndexSearcher, Lucene.Net.Search.ParallelMultiSearcher, and Lucene.Net.Search.Searcher.
Expert: Low-level search implementation. Finds the top n
hits for query
, applying filter
if non-null.
Applications should usually call Searcher.Search(Query, int) or Searcher.Search(Query,Filter,int) instead.
<throws> BooleanQuery.TooManyClauses </throws>
Implemented in Lucene.Net.Search.MultiSearcher, Lucene.Net.Search.Searcher, Lucene.Net.Search.IndexSearcher, and Lucene.Net.Search.ParallelMultiSearcher.
TopFieldDocs Lucene.Net.Search.Searchable.Search | ( | Weight | weight, |
Filter | filter, | ||
int | n, | ||
Sort | sort | ||
) |
Expert: Low-level search implementation with arbitrary sorting. Finds the top n
hits for query
, applying filter
if non-null, and sorting the hits by the criteria in sort
.
Applications should usually call Searcher.Search(Query,Filter,int,Sort) instead.
<throws> BooleanQuery.TooManyClauses </throws>
Implemented in Lucene.Net.Search.MultiSearcher, Lucene.Net.Search.IndexSearcher, Lucene.Net.Search.Searcher, and Lucene.Net.Search.ParallelMultiSearcher.
|
get |
Expert: Returns one greater than the largest possible document number. Called by search code to compute term weights.
Definition at line 91 of file Searchable.cs.