Class TurLuceneInstance
java.lang.Object
com.viglet.turing.lucene.TurLuceneInstance
Holds the Lucene index state for a single core (index directory).
Wraps the
IndexWriter, Directory, and provides a refreshable
IndexSearcher that always reflects the latest committed documents.- Since:
- 2026.1
- Author:
- Alexandre Oliveira
-
Constructor Summary
ConstructorsConstructorDescriptionTurLuceneInstance(org.apache.lucene.index.IndexWriter indexWriter, org.apache.lucene.store.Directory directory, Path indexPath, org.apache.lucene.facet.FacetsConfig facetsConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()org.apache.lucene.facet.FacetsConfigReturns theFacetsConfigused when building facet-enabled documents.org.apache.lucene.index.DirectoryReaderReturns the currentDirectoryReader, refreshing it if the index has changed.org.apache.lucene.search.IndexSearcherReturns anIndexSearcherbacked by the latest index state.org.apache.lucene.index.IndexWriter
-
Constructor Details
-
TurLuceneInstance
public TurLuceneInstance(org.apache.lucene.index.IndexWriter indexWriter, org.apache.lucene.store.Directory directory, Path indexPath, org.apache.lucene.facet.FacetsConfig facetsConfig) throws IOException - Throws:
IOException
-
-
Method Details
-
getSearcher
Returns anIndexSearcherbacked by the latest index state. If the underlying index has changed since the last call, the reader is refreshed.- Throws:
IOException
-
getReader
Returns the currentDirectoryReader, refreshing it if the index has changed.- Throws:
IOException
-
getWriter
public org.apache.lucene.index.IndexWriter getWriter() -
getIndexPath
-
getFacetsConfig
public org.apache.lucene.facet.FacetsConfig getFacetsConfig()Returns theFacetsConfigused when building facet-enabled documents. -
close
- Throws:
IOException
-