Class FullTextSettings

java.lang.Object
org.h2.fulltext.FullTextSettings

final class FullTextSettings extends Object
The global settings of a full text search.
  • Field Details

  • Constructor Details

    • FullTextSettings

      private FullTextSettings()
      Create a new instance.
  • Method Details

    • clearIgnored

      public void clearIgnored()
      Clear set of ignored words
    • addIgnored

      public void addIgnored(Iterable<String> words)
      Amend set of ignored words
      Parameters:
      words - to add
    • clearWordList

      public void clearWordList()
      Clear set of searchable words
    • getWordId

      public Integer getWordId(String word)
      Get id for a searchable word
      Parameters:
      word - to find id for
      Returns:
      Integer id or null if word is not found
    • addWord

      public void addWord(String word, Integer id)
      Register searchable word
      Parameters:
      word - to register
      id - to register with
    • getIndexInfo

      IndexInfo getIndexInfo(int indexId)
      Get the index information for the given index id.
      Parameters:
      indexId - the index id
      Returns:
      the index info
    • addIndexInfo

      void addIndexInfo(IndexInfo index)
      Add an index.
      Parameters:
      index - the index
    • convertWord

      String convertWord(String word)
      Convert a word to uppercase. This method returns null if the word is in the ignore list.
      Parameters:
      word - the word to convert and check
      Returns:
      the uppercase version of the word or null
    • getInstance

      static FullTextSettings getInstance(Connection conn) throws SQLException
      Get or create the fulltext settings for this database.
      Parameters:
      conn - the connection
      Returns:
      the settings
      Throws:
      SQLException - on failure
    • getIndexPath

      private static String getIndexPath(Connection conn) throws SQLException
      Get the file system path.
      Parameters:
      conn - the connection
      Returns:
      the file system path
      Throws:
      SQLException
    • prepare

      PreparedStatement prepare(Connection conn, String sql) throws SQLException
      Prepare a statement. The statement is cached in a soft reference cache.
      Parameters:
      conn - the connection
      sql - the statement
      Returns:
      the prepared statement
      Throws:
      SQLException - on failure
    • removeAllIndexes

      protected void removeAllIndexes()
      Remove all indexes from the settings.
    • removeIndexInfo

      protected void removeIndexInfo(IndexInfo index)
      Remove an index from the settings.
      Parameters:
      index - the index to remove
    • setInitialized

      protected void setInitialized(boolean b)
      Set the initialized flag.
      Parameters:
      b - the new value
    • isInitialized

      protected boolean isInitialized()
      Get the initialized flag.
      Returns:
      whether this instance is initialized
    • closeAll

      protected static void closeAll()
      Close all fulltext settings, freeing up memory.
    • setWhitespaceChars

      protected void setWhitespaceChars(String whitespaceChars)
    • getWhitespaceChars

      protected String getWhitespaceChars()
    • normalizeWord

      private static String normalizeWord(String word)