Class LuceneUtility

  • All Implemented Interfaces:
    java.io.Serializable

    public class LuceneUtility
    extends java.lang.Object
    implements java.io.Serializable
    Utility class providing common methods and objects for Lucene Index functionality is provided by this class.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      LuceneUtility()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.lucene.analysis.Analyzer getAnalyzer()
      Returns Analyzer object.
      static org.apache.lucene.index.IndexReader getIndexReader​(java.lang.String refsetId)
      Returns IndexReader object.
      static org.apache.lucene.search.IndexSearcher getIndexSearcher​(org.apache.lucene.index.IndexReader reader)
      Returns IndexSearcher object.
      static org.apache.lucene.index.IndexWriter getIndexWriter​(java.lang.String refsetId)
      Returns IndexWriter object.
      • Methods inherited from class java.lang.Object

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

      • INVALID_PARAMETER

        public static final java.lang.String INVALID_PARAMETER
        See Also:
        Constant Field Values
      • E_MMM_DD_HH_MM_SS_Z_YYYY

        public static final java.lang.String E_MMM_DD_HH_MM_SS_Z_YYYY
        See Also:
        Constant Field Values
      • indexWriter

        public static org.apache.lucene.index.IndexWriter indexWriter
      • indexConfig

        public static org.apache.lucene.index.IndexWriterConfig indexConfig
      • indexDirectory

        public static org.apache.lucene.store.Directory indexDirectory
    • Constructor Detail

      • LuceneUtility

        public LuceneUtility()
    • Method Detail

      • getIndexWriter

        public static org.apache.lucene.index.IndexWriter getIndexWriter​(java.lang.String refsetId)
                                                                  throws java.io.IOException
        Returns IndexWriter object.
        Parameters:
        refsetId - Identifier of Refset
        Returns:
        object of IndexWriter.
        Throws:
        java.io.IOException - if any error occurs while processing.
      • getIndexReader

        public static org.apache.lucene.index.IndexReader getIndexReader​(java.lang.String refsetId)
                                                                  throws java.io.IOException
        Returns IndexReader object.
        Parameters:
        refsetId - Identifier of Refset
        Returns:
        instance of IndexReader.
        Throws:
        java.io.IOException - if any error occurs while processing.
      • getIndexSearcher

        public static org.apache.lucene.search.IndexSearcher getIndexSearcher​(org.apache.lucene.index.IndexReader reader)
        Returns IndexSearcher object.
        Parameters:
        reader - instance of IndexReader .
        Returns:
        IndexSearcher.
      • getAnalyzer

        public static org.apache.lucene.analysis.Analyzer getAnalyzer()
        Returns Analyzer object.
        Returns:
        Analyzer.