Class SurrogateIndexSearcher
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, if your index is unchanging, you should share a single SurrogateIndexSearcher instance across multiple searches instead of creating a new one per-search. If your index has changed and you wish to see the changes reflected in searching, you should use OpenIfChanged(DirectoryReader) to obtain a new reader and then create a new SurrogateIndexSearcher from that. Also, for low-latency turnaround it's best to use a near-real-time reader (Open(IndexWriter, Boolean)). Once you have a new IndexReader, it's relatively cheap to create a new SurrogateIndexSearcher from it.
NOTE: SurrogateIndexSearcher instances are completely thread safe, meaning multiple threads can call any of its methods, concurrently. If your application requires external synchronization, you should not synchronize on the SurrogateIndexSearcher instance; use your own (non-Lucene) objects instead.
Inheritance
Assembly: Lucene.Net.dll
Syntax
[Serializable]
public class SurrogateIndexSearcher : ServerSurrogateObject
Constructors
Name | Description |
---|---|
SurrogateIndexSearcher(String, IndexReader, TaskScheduler) | Runs searches for each segment separately, using the provided System.Threading.Tasks.TaskScheduler. SurrogateIndexSearcher will not shutdown/awaitTermination this System.Threading.Tasks.TaskScheduler on dispose; you must do so, eventually, on your own. @lucene.experimental |
SurrogateIndexSearcher(String, IndexReaderContext) | Creates a searcher searching the provided top-level IndexReaderContext. @lucene.experimental |
SurrogateIndexSearcher(String, IndexReaderContext, TaskScheduler) | Creates a searcher searching the provided top-level IndexReaderContext.
Given a non- @lucene.experimental |
SurrogateIndexSearcher(String, SurrogateIndexReader, CacheContext, IDataFormatService, IObjectContainer) | Creates a searcher searching the provided index. |
Fields
Name | Description |
---|---|
m_leafContexts | |
m_leafSlices | Used with executor - each slice holds a set of leafs executed within one thread |
m_readerContext |
Properties
Name | Description |
---|---|
DefaultSimilarity | Expert: returns a default Similarity instance. In general, this method is only called to initialize searchers and writers. User code and query implementations should respect Similarity. @lucene.internal |
IndexReader | Return the IndexReader this searches. |
IsRenewable | |
Similarity | Expert: Set the Similarity implementation used by this IndexSearcher. |
TopReaderContext | Returns this searchers the top-level IndexReaderContext. |
WrappedInstance |
Methods
Name | Description |
---|---|
CollectionStatistics(String) | Returns CollectionStatistics for a field. This can be overridden for example, to return a field's statistics across a distributed collection. @lucene.experimental |
CreateNormalizedWeight(Query) | Creates a normalized weight for a top-level Query.
The query is rewritten by this method and @lucene.internal |
Dispose() | |
Doc(Int32) | Sugar for
|
Doc(Int32, StoredFieldVisitor) | Sugar for
|
Doc(Int32, ISet<String>) | Sugar for
|
Document(Int32, ISet<String>) | |
Explain(Query, Int32) | Returns an Explanation that describes how 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. |
Explain(Weight, Int32) | Expert: low-level implementation method
Returns an Explanation that describes how 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 Explain(Query, Int32). |
GetConfiguredNodesList() | |
InvokeMethod(String, Int32, Object[], ModuleOperationContext) | |
InvokePropertyGetter(String) | |
InvokePropertySetter(String, Object) | |
Rewrite(Query) | Expert: called to re-write queries into primitive queries. |
Search(Query, Filter, ICollector) | Lower-level search API. Collect(Int32) is called for every matching document. |
Search(Query, Filter, Int32) | Finds the top |
Search(Query, Filter, Int32, Sort) | Search implementation with arbitrary sorting. Finds
the top NOTE: this does not compute scores by default; use Search(Query, Filter, Int32, Sort, Boolean, Boolean) to control scoring. |
Search(Query, Filter, Int32, Sort, Boolean, Boolean) | Search implementation with arbitrary sorting, plus
control over whether hit scores and max score
should be computed. Finds
the top |
Search(Query, ICollector) | Lower-level search API. Collect(Int32) is called for every matching document. |
Search(Query, Int32) | Finds the top |
Search(Query, Int32, Sort) | Search implementation with arbitrary sorting and no filter. |
Search(Weight, FieldDoc, Int32, Sort, Boolean, Boolean, Boolean) | Just like Search(Weight, Int32, Sort, Boolean, Boolean), but you choose
whether or not the fields in the returned FieldDoc instances should
be set by specifying |
Search(Weight, ScoreDoc, Int32) | Expert: Low-level search implementation. Finds the top Applications should usually call Search(Query, Int32) or Search(Query, Filter, Int32) instead. |
Search(Weight, Int32, Sort, Boolean, Boolean) | Expert: Low-level search implementation with arbitrary
sorting and control over whether hit scores and max
score should be computed. Finds
the top Applications should usually call Search(Query, Filter, Int32, Sort) instead. |
Search(IList<AtomicReaderContext>, Weight, FieldDoc, Int32, Sort, Boolean, Boolean, Boolean) | Just like Search(Weight, Int32, Sort, Boolean, Boolean), but you choose
whether or not the fields in the returned FieldDoc instances should
be set by specifying |
Search(IList<AtomicReaderContext>, Weight, ICollector) | Lower-level search API. Collect(Int32) is called for every document. NOTE: this method executes the searches on all given leaves exclusively. To search across all the searchers leaves use m_leafContexts. |
Search(IList<AtomicReaderContext>, Weight, ScoreDoc, Int32) | Expert: Low-level search implementation. Finds the top
hits for query .
Applications should usually call Search(Query, Int32) or Search(Query, Filter, Int32) instead. |
SearchAfter(ScoreDoc, Query, Filter, Int32) | Finds the top
By passing the bottom result from a previous page as |
SearchAfter(ScoreDoc, Query, Filter, Int32, Sort) | Finds the top
By passing the bottom result from a previous page as |
SearchAfter(ScoreDoc, Query, Filter, Int32, Sort, Boolean, Boolean) | Finds the top
By passing the bottom result from a previous page as |
SearchAfter(ScoreDoc, Query, Int32) | Finds the top
By passing the bottom result from a previous page as |
SearchAfter(ScoreDoc, Query, Int32, Sort) | Finds the top
By passing the bottom result from a previous page as |
Slices(IList<AtomicReaderContext>) | Expert: Creates an array of leaf slices each holding a subset of the given leaves. Each SurrogateIndexSearcher.LeafSlice is executed in a single thread. By default there will be one SurrogateIndexSearcher.LeafSlice per leaf (AtomicReaderContext). |
TermStatistics(Term, TermContext) | Returns TermStatistics for a term. This can be overridden for example, to return a term's statistics across a distributed collection. @lucene.experimental |
ToString() | |
WrapFilter(Query, Filter) | @lucene.internal |