Section navigation

Public classSealed 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

Public constructor SearcherManager(MMapDirectory, SearcherManagerConfig?)

Initialises a searcher manager for the specified directory.

Public property ConsecutiveRefreshFailures

The number of consecutive failed refreshes since the last successful refresh.

Public property LastRefreshError

The exception thrown by the most recent refresh attempt, or null when none has failed.

Public property LastRefreshErrorAt

The UTC timestamp at which the most recent refresh exception was recorded.

Public method Acquire()

Acquires the current searcher. Call Release(IndexSearcher) when finished.

Public method AcquireLease()

Acquires a scoped reference to the current searcher.

Public method Dispose()

Stops refreshes and disposes retained searchers after their leases end.

Public method GetDiagnostics()

Gets generic lifecycle diagnostics for the managed searchers.

Public method MaybeRefresh()

Synchronously checks for a new commit and publishes a replacement when required.

Public method MaybeRefreshAsync(CancellationToken)

Async variant of MaybeRefresh().

Public method Release(IndexSearcher)

Releases a searcher acquired through Acquire().

Public method UsingSearcher<T>(Func<IndexSearcher, T>)

Runs an action with a leased searcher and releases it afterwards.

Public event RefreshFailed

Raised when a refresh fails.