Class FullTextLucene.IndexAccess

  • Enclosing class:
    FullTextLucene

    private static final class FullTextLucene.IndexAccess
    extends java.lang.Object
    A wrapper for the Lucene writer and searcher.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.apache.lucene.search.IndexSearcher searcher
      The index searcher.
      (package private) org.apache.lucene.index.IndexWriter writer
      The index writer.
    • Constructor Summary

      Constructors 
      Constructor Description
      IndexAccess​(org.apache.lucene.index.IndexWriter writer)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close the index.
      void commit()
      Commit the changes.
      (package private) org.apache.lucene.search.IndexSearcher getSearcher()
      Start using the searcher.
      private void initializeSearcher()  
      (package private) void returnSearcher​(org.apache.lucene.search.IndexSearcher searcher)
      Stop using the searcher.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • writer

        final org.apache.lucene.index.IndexWriter writer
        The index writer.
      • searcher

        private org.apache.lucene.search.IndexSearcher searcher
        The index searcher.
    • Constructor Detail

      • IndexAccess

        IndexAccess​(org.apache.lucene.index.IndexWriter writer)
             throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getSearcher

        org.apache.lucene.search.IndexSearcher getSearcher()
                                                    throws java.io.IOException
        Start using the searcher.
        Returns:
        the searcher
        Throws:
        java.io.IOException - on failure
      • initializeSearcher

        private void initializeSearcher()
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • returnSearcher

        void returnSearcher​(org.apache.lucene.search.IndexSearcher searcher)
                     throws java.io.IOException
        Stop using the searcher.
        Parameters:
        searcher - the searcher
        Throws:
        java.io.IOException - on failure
      • commit

        public void commit()
                    throws java.io.IOException
        Commit the changes.
        Throws:
        java.io.IOException - on failure
      • close

        public void close()
                   throws java.io.IOException
        Close the index.
        Throws:
        java.io.IOException - on failure