
IndexSearcher
- Namespace
- Rowles.LeanLucene.Search.Searcher
- Assembly
- Rowles.LeanLucene.dll
Holds a snapshot of segment readers and executes queries across all segments.
public sealed class IndexSearcher : IDisposable
IndexSearcher(MMapDirectory, ISimilarity?)
Initialises a new IndexSearcher by loading the latest committed segments from the given directory.
IndexSearcher(MMapDirectory, IndexSearcherConfig)
Initialises a new IndexSearcher by loading the latest committed segments from the given directory.
IndexSearcher(MMapDirectory, IReadOnlyList<SegmentInfo>, ISimilarity?)
Initialises a new IndexSearcher over the given pre-built segment list (NRT or snapshot scenario).
IndexSearcher(MMapDirectory, IReadOnlyList<SegmentInfo>, IndexSearcherConfig)
Initialises a new IndexSearcher over the given pre-built segment list with the specified configuration.
t_collectorHeapCache
t_docFreqTermsBuf
t_fallbackCandidateIds
t_fallbackInCandidate
t_fallbackInClause
t_fallbackInUse
t_fallbackScores
t_postingsBuffer
Cache
The query result cache, or null if caching is disabled.
Metrics
The metrics collector for this searcher.
Stats
Corpus-wide statistics computed at construction.
Dispose()
Disposes all underlying segment readers.

ExecuteMoreLikeThis(MoreLikeThisQuery, int)
Explain(TermQuery, int)
Explains the score computation for a specific document and query. Returns null if the document does not match the query.
Explain(VectorQuery, int)
Explains the score and execution strategy for a VectorQuery against a specific document.
Surfaces the chosen ANN strategy (flat scan, HNSW two-phase, brute-force filter,
HNSW pre-filter, HNSW post-filter), the configured ef, and shortlist size.
Returns null if the document does not exist or has no vector for the query field.
GetIndexSize()
Calculates the on-disk size of the index.
GetStoredFields(int)
Retrieves stored fields for a global document ID.
MoreLikeThis(int, string[], int, MoreLikeThisParameters?)
Convenience API: finds documents similar to the given document. Extracts significant terms from term vectors and re-queries the index.
Search(Query, int)
Executes a query and returns the top-topN scoring documents.
Checks the query cache first, then falls back to the full search pipeline.
Search(Query, int, SortField)
Searches with a custom sort order instead of relevance ranking. Matching documents are collected and then ordered by the requested field.
Search(Query, int, CancellationToken)
Searches with cancellation support. Checks the token between segments and between inner sub-clauses, allowing long-running queries to be interrupted.
Search(string, string, int, IAnalyser?)
Parses a query string, applies analysis, and searches.
Search(string, string, int, IAnalyser?, CancellationToken)
Parses a query string and searches with cancellation support.
SearchWithAggregations(Query, int, params AggregationRequest[])
Executes a search query and computes numeric aggregations over matching documents.
SearchWithCollapse(Query, int, CollapseField)
Executes a search and collapses results so only the best document per unique field value is returned. Uses SortedDocValues for the collapse field.
SearchWithFacets(Query, int, params string[])
Executes a query and returns both top-N results and facet counts for the specified fields.
Suggest(string, string, int)
Returns the top-N terms with the given prefix for auto-complete / suggest, ranked by global document frequency descending.