Class SearcherTaxonomyManager
Manages near-real-time reopen of both an Lucene.Net.Search.IndexSearcher and a TaxonomyReader.
NOTE: If you call ReplaceTaxonomy(Directory) then you must open a new SearcherTaxonomyManager afterwards.
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Facet.Taxonomy
Assembly: Lucene.Net.Facet.dll
Syntax
public class SearcherTaxonomyManager : ReferenceManager<SearcherTaxonomyManager.SearcherAndTaxonomy>, IDisposable
Constructors
SearcherTaxonomyManager(IndexWriter, bool, SearcherFactory, DirectoryTaxonomyWriter)
Creates near-real-time searcher and taxonomy reader from the corresponding writers.
Declaration
public SearcherTaxonomyManager(IndexWriter writer, bool applyAllDeletes, SearcherFactory searcherFactory, DirectoryTaxonomyWriter taxoWriter)
Parameters
Type | Name | Description |
---|---|---|
IndexWriter | writer | |
bool | applyAllDeletes | |
SearcherFactory | searcherFactory | |
DirectoryTaxonomyWriter | taxoWriter |
SearcherTaxonomyManager(Directory, Directory, SearcherFactory)
Creates search and taxonomy readers over the corresponding directories.
NOTE: you should only use this constructor if you commit and call Lucene.Net.Search.ReferenceManager<G>.MaybeRefresh() (on the Lucene.Net.Index.ReaderManager) in the same thread. Otherwise it could lead to an unsync'd Lucene.Net.Search.IndexSearcher and TaxonomyReader pair.
Declaration
public SearcherTaxonomyManager(Directory indexDir, Directory taxoDir, SearcherFactory searcherFactory)
Parameters
Type | Name | Description |
---|---|---|
Directory | indexDir | |
Directory | taxoDir | |
SearcherFactory | searcherFactory |
Methods
DecRef(SearcherAndTaxonomy)
Decrement reference counting on the given reference.
Declaration
protected override void DecRef(SearcherTaxonomyManager.SearcherAndTaxonomy @ref)
Parameters
Type | Name | Description |
---|---|---|
SearcherTaxonomyManager.SearcherAndTaxonomy | ref |
Overrides
Exceptions
Type | Condition |
---|---|
IOException | If reference decrement on the given resource failed. |
GetRefCount(SearcherAndTaxonomy)
Returns the current reference count of the given reference.
Declaration
protected override int GetRefCount(SearcherTaxonomyManager.SearcherAndTaxonomy reference)
Parameters
Type | Name | Description |
---|---|---|
SearcherTaxonomyManager.SearcherAndTaxonomy | reference |
Returns
Type | Description |
---|---|
int |
Overrides
RefreshIfNeeded(SearcherAndTaxonomy)
Refresh the given reference if needed. Returns null
if no refresh
was needed, otherwise a new refreshed reference.
Declaration
protected override SearcherTaxonomyManager.SearcherAndTaxonomy RefreshIfNeeded(SearcherTaxonomyManager.SearcherAndTaxonomy @ref)
Parameters
Type | Name | Description |
---|---|---|
SearcherTaxonomyManager.SearcherAndTaxonomy | ref |
Returns
Type | Description |
---|---|
SearcherTaxonomyManager.SearcherAndTaxonomy |
Overrides
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | If the reference manager has been Lucene.Net.Search.ReferenceManager<G>.Dispose()d. |
IOException | If the refresh operation failed |
TryIncRef(SearcherAndTaxonomy)
Try to increment reference counting on the given reference. Returns true
if
the operation was successful.
Declaration
protected override bool TryIncRef(SearcherTaxonomyManager.SearcherAndTaxonomy @ref)
Parameters
Type | Name | Description |
---|---|---|
SearcherTaxonomyManager.SearcherAndTaxonomy | ref |
Returns
Type | Description |
---|---|
bool |
Overrides
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | if the reference manager has been Lucene.Net.Search.ReferenceManager<G>.Dispose()d. |