public class SearcherTaxonomyManager extends ReferenceManager<SearcherTaxonomyManager.SearcherAndTaxonomy>
NOTE: If you call DirectoryTaxonomyWriter.replaceTaxonomy(org.apache.lucene.store.Directory)
then you must
open a new SearcherTaxonomyManager
afterwards.
Modifier and Type | Class and Description |
---|---|
static class |
SearcherTaxonomyManager.SearcherAndTaxonomy
Holds a matched pair of
IndexSearcher and
TaxonomyReader |
ReferenceManager.RefreshListener
current
Constructor and Description |
---|
SearcherTaxonomyManager(Directory indexDir,
Directory taxoDir,
SearcherFactory searcherFactory)
Creates search and taxonomy readers over the corresponding directories.
|
SearcherTaxonomyManager(IndexReader reader,
DirectoryTaxonomyReader taxoReader,
SearcherFactory searcherFactory)
Creates this from already opened
IndexReader and DirectoryTaxonomyReader instances. |
SearcherTaxonomyManager(IndexWriter writer,
boolean applyAllDeletes,
SearcherFactory searcherFactory,
DirectoryTaxonomyWriter taxoWriter)
Expert: creates near-real-time searcher and taxonomy reader
from the corresponding writers, controlling whether deletes should be applied.
|
SearcherTaxonomyManager(IndexWriter writer,
SearcherFactory searcherFactory,
DirectoryTaxonomyWriter taxoWriter)
Creates near-real-time searcher and taxonomy reader
from the corresponding writers.
|
Modifier and Type | Method and Description |
---|---|
protected void |
decRef(SearcherTaxonomyManager.SearcherAndTaxonomy ref) |
protected int |
getRefCount(SearcherTaxonomyManager.SearcherAndTaxonomy reference) |
protected SearcherTaxonomyManager.SearcherAndTaxonomy |
refreshIfNeeded(SearcherTaxonomyManager.SearcherAndTaxonomy ref) |
protected boolean |
tryIncRef(SearcherTaxonomyManager.SearcherAndTaxonomy ref) |
acquire, addListener, afterClose, afterMaybeRefresh, close, maybeRefresh, maybeRefreshBlocking, release, removeListener
public SearcherTaxonomyManager(IndexWriter writer, SearcherFactory searcherFactory, DirectoryTaxonomyWriter taxoWriter) throws IOException
IOException
public SearcherTaxonomyManager(IndexWriter writer, boolean applyAllDeletes, SearcherFactory searcherFactory, DirectoryTaxonomyWriter taxoWriter) throws IOException
IOException
public SearcherTaxonomyManager(Directory indexDir, Directory taxoDir, SearcherFactory searcherFactory) throws IOException
NOTE: you should only use this constructor if you commit and call
ReferenceManager.maybeRefresh()
in the same thread. Otherwise it could lead to an
unsync'd IndexSearcher
and TaxonomyReader
pair.
IOException
public SearcherTaxonomyManager(IndexReader reader, DirectoryTaxonomyReader taxoReader, SearcherFactory searcherFactory) throws IOException
IndexReader
and DirectoryTaxonomyReader
instances. Note that
the incoming readers will be closed when you call ReferenceManager.close()
.IOException
protected void decRef(SearcherTaxonomyManager.SearcherAndTaxonomy ref) throws IOException
decRef
in class ReferenceManager<SearcherTaxonomyManager.SearcherAndTaxonomy>
IOException
protected boolean tryIncRef(SearcherTaxonomyManager.SearcherAndTaxonomy ref) throws IOException
tryIncRef
in class ReferenceManager<SearcherTaxonomyManager.SearcherAndTaxonomy>
IOException
protected SearcherTaxonomyManager.SearcherAndTaxonomy refreshIfNeeded(SearcherTaxonomyManager.SearcherAndTaxonomy ref) throws IOException
refreshIfNeeded
in class ReferenceManager<SearcherTaxonomyManager.SearcherAndTaxonomy>
IOException
protected int getRefCount(SearcherTaxonomyManager.SearcherAndTaxonomy reference)
getRefCount
in class ReferenceManager<SearcherTaxonomyManager.SearcherAndTaxonomy>
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.