Class IndexSearcher
Implements search over a single IndexReader.
Applications usually need only call the inherited Search(Query, Int32) or Search(Query, Filter, Int32) methods. For performance reasons it is recommended to open only one IndexSearcher and use it for all of your searches.
NOTE:
IndexIndexSearcher
instance;
use your own (non-Lucene) objects instead.
Inherited Members
Namespace:
Assembly: Lucene.Net.NetCore.dll
Syntax
public class IndexSearcher : Searcher, Searchable, IDisposable, IDisposable
Constructors
Name | Description |
---|---|
Index |
Creates a searcher searching the provided index Note that the underlying IndexReader is not closed, if IndexSearcher was constructed with IndexSearcher(IndexReader r). If the IndexReader was supplied implicitly by specifying a directory, then the IndexReader gets closed. |
Index |
Expert: directly specify the reader, subReaders and their DocID starts NOTE: This API is experimental and might change in incompatible ways in the next release
|
Index |
Creates a searcher searching the index in the named directory, with readOnly=true |
Index |
Creates a searcher searching the index in the named directory. You should pass readOnly=true, since it gives much better concurrent performance, unless you intend to do write operations (delete documents or change norms) with the underlying IndexReader. |
Properties
Name | Description |
---|---|
Index |
Return the Index |
Max |
|
reader_For |
Methods
Name | Description |
---|---|
Dispose(Boolean) | |
Doc(Int32) | |
Doc(Int32, Field |
|
Doc |
|
Explain(Weight, Int32) | |
GatherSubReaders(Collections.Generic.IList<IndexReader>, IndexReader) | |
Rewrite(Query) | |
Search(Weight, Filter, Collector) | |
Search(Weight, Filter, Int32) | |
Search(Weight, Filter, Int32, Sort) | |
Search(Weight, Filter, Int32, Sort, Boolean) | Just like Search(Weight, Filter, Int32, Sort), but you choose
whether or not the fields in the returned Field
NOTE: this does not compute scores by default. If you need scores, create
a Top
|
Set |
By default, no scores are computed when sorting by field (using Search(Query, Filter, Int32, Sort)). You can change that, per IndexSearcher instance, by calling this method. Note that this will incur a CPU cost. |