Class LuceneUtils


  • public abstract class LuceneUtils
    extends java.lang.Object

    Utility methods for the Lucene optional tool.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String TEXT_FIELD_NAME  
    • Constructor Summary

      Constructors 
      Constructor Description
      LuceneUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.lucene.util.Version currentVersion()
      Get the version of the Lucene library on the classpath.
      static org.apache.lucene.analysis.Analyzer defaultAnalyzer()
      Get the default Analyzer associated with the database Locale.
      static LuceneIndexDescriptor defaultIndexDescriptor()
      Get the default index descriptor.
      static org.apache.lucene.queryparser.classic.QueryParser defaultQueryParser​(org.apache.lucene.util.Version version, java.lang.String[] fieldNames, org.apache.lucene.analysis.Analyzer analyzer)
      Get the default, classic QueryParser.
      static org.apache.lucene.analysis.Analyzer getAnalyzerForLocale​(java.util.Locale locale)
      Get the Analyzer associated with the given Locale.
      static org.apache.lucene.analysis.Analyzer standardAnalyzer()
      Get the StandardAnalyzer for parsing text.
      • Methods inherited from class java.lang.Object

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

    • Constructor Detail

      • LuceneUtils

        public LuceneUtils()
    • Method Detail

      • currentVersion

        public static org.apache.lucene.util.Version currentVersion()
        Get the version of the Lucene library on the classpath.
      • defaultAnalyzer

        public static org.apache.lucene.analysis.Analyzer defaultAnalyzer()
                                                                   throws java.sql.SQLException

        Get the default Analyzer associated with the database Locale.

        Throws:
        java.sql.SQLException
      • getAnalyzerForLocale

        public static org.apache.lucene.analysis.Analyzer getAnalyzerForLocale​(java.util.Locale locale)
                                                                        throws java.sql.SQLException

        Get the Analyzer associated with the given Locale.

        Throws:
        java.sql.SQLException
      • standardAnalyzer

        public static org.apache.lucene.analysis.Analyzer standardAnalyzer()

        Get the StandardAnalyzer for parsing text.

      • defaultQueryParser

        public static org.apache.lucene.queryparser.classic.QueryParser defaultQueryParser​(org.apache.lucene.util.Version version,
                                                                                           java.lang.String[] fieldNames,
                                                                                           org.apache.lucene.analysis.Analyzer analyzer)

        Get the default, classic QueryParser.

      • defaultIndexDescriptor

        public static LuceneIndexDescriptor defaultIndexDescriptor()

        Get the default index descriptor. This has a single field named TEXT, a defaultAnalyzer() and a defaultQueryParser().