Package org.apache.lucene.facet.taxonomy
Class SearcherTaxonomyManager
- java.lang.Object
-
- org.apache.lucene.search.ReferenceManager<SearcherTaxonomyManager.SearcherAndTaxonomy>
-
- org.apache.lucene.facet.taxonomy.SearcherTaxonomyManager
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class SearcherTaxonomyManager extends ReferenceManager<SearcherTaxonomyManager.SearcherAndTaxonomy>
Manages near-real-time reopen of both an IndexSearcher and a TaxonomyReader.NOTE: If you call
DirectoryTaxonomyWriter.replaceTaxonomy(org.apache.lucene.store.Directory)
then you must open a newSearcherTaxonomyManager
afterwards.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SearcherTaxonomyManager.SearcherAndTaxonomy
Holds a matched pair ofIndexSearcher
andTaxonomyReader
-
Nested classes/interfaces inherited from class org.apache.lucene.search.ReferenceManager
ReferenceManager.RefreshListener
-
-
Constructor Summary
Constructors Constructor Description SearcherTaxonomyManager(IndexWriter writer, boolean applyAllDeletes, SearcherFactory searcherFactory, DirectoryTaxonomyWriter taxoWriter)
Creates near-real-time searcher and taxonomy reader from the corresponding writers.SearcherTaxonomyManager(Directory indexDir, Directory taxoDir, SearcherFactory searcherFactory)
Creates search and taxonomy readers over the corresponding directories.
-
Method Summary
-
Methods inherited from class org.apache.lucene.search.ReferenceManager
acquire, addListener, close, maybeRefresh, maybeRefreshBlocking, release, removeListener
-
-
-
-
Constructor Detail
-
SearcherTaxonomyManager
public SearcherTaxonomyManager(IndexWriter writer, boolean applyAllDeletes, SearcherFactory searcherFactory, DirectoryTaxonomyWriter taxoWriter) throws java.io.IOException
Creates near-real-time searcher and taxonomy reader from the corresponding writers.- Throws:
java.io.IOException
-
SearcherTaxonomyManager
public SearcherTaxonomyManager(Directory indexDir, Directory taxoDir, SearcherFactory searcherFactory) throws java.io.IOException
Creates search and taxonomy readers over the corresponding directories.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'dIndexSearcher
andTaxonomyReader
pair.- Throws:
java.io.IOException
-
-