Module org.apache.derby.optionaltools
Package org.apache.derby.optional.api

# Class LuceneUtils

java.lang.Object
org.apache.derby.optional.api.LuceneUtils

public abstract class LuceneUtils extends Object

Utility methods for the Lucene optional tool.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `LuceneUtils.DefaultIndexDescriptor`
  The default LuceneIndexDescriptor

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `TEXT_FIELD_NAME`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LuceneUtils()`

- ## Method Summary

  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, String[] fieldNames, org.apache.lucene.analysis.Analyzer analyzer)`
  Get the default, classic QueryParser.
  `static org.apache.lucene.analysis.Analyzer`
  `getAnalyzerForLocale(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 Details

  - ### TEXT_FIELD_NAME

    public static final String TEXT_FIELD_NAME
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### LuceneUtils

    public LuceneUtils()

- ## Method Details

  - ### currentVersion

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

  - ### defaultAnalyzer

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

    Get the default Analyzer associated with the database Locale.

    Returns:
      the default Analyzer
    Throws:
      `SQLException` - on error

  - ### getAnalyzerForLocale

    public static org.apache.lucene.analysis.Analyzer getAnalyzerForLocale(Locale locale) throws SQLException

    Get the Analyzer associated with the given Locale.

    Parameters:
      `locale` - The locale whose Analyzer is needed
    Returns:
      the Analyzer associated with the given Locale.
    Throws:
      `SQLException` - on error

  - ### standardAnalyzer

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

    Get the StandardAnalyzer for parsing text.

    Returns:
      the standard Analyzer

  - ### defaultQueryParser

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

    Get the default, classic QueryParser.

    Parameters:
      `version` - The Lucene version
      `fieldNames` - The field names of interest
      `analyzer` - The Analyzer to use
    Returns:
      the corresponding QueryParser

  - ### defaultIndexDescriptor

    public static LuceneIndexDescriptor defaultIndexDescriptor()

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

    Returns:
      the default index descriptor