Class LuceneFormSearchFactory


  • public class LuceneFormSearchFactory
    extends java.lang.Object
    Factory for the search on Directory
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.lucene.analysis.Analyzer getAnalyzer()
      Return the Analyzer to use for the search
      org.apache.lucene.store.Directory getDirectory()
      Return the Directory to use for the search
      org.apache.lucene.store.Directory getDirectoryTemp()
      Return the temporary Directory to use for the search
      org.apache.lucene.index.IndexWriter getIndexWriter​(java.lang.Boolean bCreateIndex, boolean mainDirectory)
      Create the IndexWriter with its configuration
      java.lang.String getPathDirectory​(boolean tempDirectory)
      Return path to the directory
      void swapIndex()
      Delete the old main directory and move the temporary to the main Path
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LuceneFormSearchFactory

        public LuceneFormSearchFactory()
    • Method Detail

      • getAnalyzer

        public org.apache.lucene.analysis.Analyzer getAnalyzer()
        Return the Analyzer to use for the search
        Returns:
        the Analyzer to use for the search
      • getIndexWriter

        public org.apache.lucene.index.IndexWriter getIndexWriter​(java.lang.Boolean bCreateIndex,
                                                                  boolean mainDirectory)
        Create the IndexWriter with its configuration
        Parameters:
        bCreateIndex - The boolean which tell if the index must be created
        mainDirectory - The boolean which tell if the index must be created on the main Directory or in a temporary Directory
        Returns:
        the created IndexWriter
      • getPathDirectory

        public java.lang.String getPathDirectory​(boolean tempDirectory)
        Return path to the directory
        Parameters:
        tempDirectory - if true return path for the temporary directory
        Returns:
        String Path
      • getDirectory

        public org.apache.lucene.store.Directory getDirectory()
                                                       throws java.io.IOException
        Return the Directory to use for the search
        Returns:
        the Directory to use for the search
        Throws:
        java.io.IOException - - if the path string cannot be converted to a Path
      • getDirectoryTemp

        public org.apache.lucene.store.Directory getDirectoryTemp()
                                                           throws java.io.IOException
        Return the temporary Directory to use for the search
        Returns:
        the Directory to use for the search
        Throws:
        java.io.IOException - - if the path string cannot be converted to a Path
      • swapIndex

        public void swapIndex()
        Delete the old main directory and move the temporary to the main Path