
SearcherManager
- Namespace
- Rowles.LeanCorpus.Search.Searcher
- Assembly
- Rowles.LeanCorpus.dll
Manages the lifecycle of IndexSearcher instances through the generic reader manager.
public sealed class SearcherManager : IDisposable
- Inheritance
-
SearcherManager
- Implements
SearcherManager(MMapDirectory, SearcherManagerConfig?)
Initialises a searcher manager for the specified directory.
ConsecutiveRefreshFailures
The number of consecutive failed refreshes since the last successful refresh.
LastRefreshError
The exception thrown by the most recent refresh attempt, or null when none has failed.
LastRefreshErrorAt
The UTC timestamp at which the most recent refresh exception was recorded.
Acquire()
Acquires the current searcher. Call Release(IndexSearcher) when finished.
AcquireLease()
Acquires a scoped reference to the current searcher.
Dispose()
Stops refreshes and disposes retained searchers after their leases end.
GetDiagnostics()
Gets generic lifecycle diagnostics for the managed searchers.
MaybeRefresh()
Synchronously checks for a new commit and publishes a replacement when required.
MaybeRefreshAsync(CancellationToken)
Async variant of MaybeRefresh().
Release(IndexSearcher)
Releases a searcher acquired through Acquire().
UsingSearcher<T>(Func<IndexSearcher, T>)
Runs an action with a leased searcher and releases it afterwards.
RefreshFailed
Raised when a refresh fails.