Class LuceneFormSearchFactory
java.lang.Object
fr.paris.lutece.plugins.forms.service.search.LuceneFormSearchFactory
Factory for the search on Directory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.analysis.AnalyzerReturn the Analyzer to use for the searchorg.apache.lucene.store.DirectoryReturn the Directory to use for the searchorg.apache.lucene.store.DirectoryReturn the temporary Directory to use for the searchorg.apache.lucene.index.IndexWritergetIndexWriter(Boolean bCreateIndex, boolean mainDirectory) Create the IndexWriter with its configurationgetPathDirectory(boolean tempDirectory) Return path to the directoryvoidDelete the old main directory and move the temporary to the main Path
-
Constructor Details
-
LuceneFormSearchFactory
public LuceneFormSearchFactory()
-
-
Method Details
-
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(Boolean bCreateIndex, boolean mainDirectory) Create the IndexWriter with its configuration- Parameters:
bCreateIndex- The boolean which tell if the index must be createdmainDirectory- The boolean which tell if the index must be created on the main Directory or in a temporary Directory- Returns:
- the created IndexWriter
-
getPathDirectory
Return path to the directory- Parameters:
tempDirectory- if true return path for the temporary directory- Returns:
- String Path
-
getDirectory
Return the Directory to use for the search- Returns:
- the Directory to use for the search
- Throws:
IOException- - if the path string cannot be converted to a Path
-
getDirectoryTemp
Return the temporary Directory to use for the search- Returns:
- the Directory to use for the search
- Throws:
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
-