Class LuceneIndex

  • All Implemented Interfaces:
    SearchIndex
    Direct Known Subclasses:
    LuceneIndexNIOFS

    public class LuceneIndex
    extends AbstractLuceneIndex
    A LuceneIndex is a one-stop-shop abstraction of a Lucene index. It takes care of proper synchronization of IndexReaders, IndexWriters and IndexSearchers in a way that is suitable for a LuceneSail.
    See Also:
    LuceneSail
    • Field Detail

      • currentMonitor

        protected volatile ReaderMonitor currentMonitor
        This holds IndexReader and IndexSearcher.
    • Constructor Detail

      • LuceneIndex

        public LuceneIndex()
      • LuceneIndex

        public LuceneIndex​(org.apache.lucene.store.Directory directory,
                           org.apache.lucene.analysis.Analyzer analyzer)
                    throws IOException
        Constructor for keeping backwards compatibility.
        Parameters:
        directory -
        analyzer -
        Throws:
        IOException
      • LuceneIndex

        public LuceneIndex​(org.apache.lucene.store.Directory directory,
                           org.apache.lucene.analysis.Analyzer analyzer,
                           org.apache.lucene.search.similarities.Similarity similarity)
                    throws IOException
        Creates a new LuceneIndex.
        Parameters:
        directory - The Directory in which an index can be found and/or in which index files are written.
        analyzer - The Analyzer that will be used for tokenizing strings to index and queries.
        similarity - The Similarity that will be used for scoring.
        Throws:
        IOException - When the Directory could not be unlocked.