| Modifier and Type | Class and Description |
|---|---|
| public static class | FullText.
Trigger updates the index when a inserting, updating, or deleting a row. |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | FIELD_COLUMNS
A column name of the result set returned by the searchData method. |
| private static final String | FIELD_KEYS
A column name of the result set returned by the searchData method. |
| private static final String | FIELD_QUERY
The column name of the result set returned by the search method. |
| private static final String | FIELD_SCHEMA
A column name of the result set returned by the searchData method. |
| private static final String | FIELD_SCORE
The hit score. |
| private static final String | FIELD_TABLE
A column name of the result set returned by the searchData method. |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static void | addColumnData(SessionLocal session, ArrayList<String> columns, ArrayList<String> data, Expression expr)
|
| protected static void | addWords(FullTextSettings
the fulltext settings setting, Set<String> the hash set set, Reader the reader reader)Add all words in the given text to the hash set. |
| protected static void | addWords(FullTextSettings
the fulltext settings setting, Set<String> the hash set set, String the text text)Add all words in the given text to the hash set. |
| protected static String | |
| public static void | |
| public static void | createIndex(Connection
the connection conn, String the schema name of the table (case sensitive) schema, String the table name (case sensitive) table, String the column list (null for all columns) columnList)Create a new full text index for a table and column list. |
| private static void | |
| protected static SimpleResultSet | Returns: the empty result settrue if the result set should contain the primary key data as
an array. data)Create an empty search result and initialize the columns. |
| private static void | createTrigger(Connection
the database connection conn, String the schema name schema, String the table name table)Create the trigger. |
| public static void | |
| public static void | dropIndex(Connection
the connection conn, String the schema name of the table (case sensitive) schema, String the table name (case sensitive) table)Drop an existing full text index for a table. |
| protected static boolean | Returns: true if the indexed columns don't matchthe old row oldRow, Object[] the new row newRow, int[] the indexed columns indexColumns)Check if a the indexed columns of a row probably have changed. |
| private static void | indexExistingRows(Connection
the database connection conn, String the schema name schema, String the table name table)Add the existing data to the index. |
| public static void | |
| protected static String[][] | Returns: an array containing the column name list and the data listthe database connection conn, String the primary key condition as a string key)Parse a primary key condition into the primary key columns. |
| protected static String | |
| private static String | |
| public static void | |
| protected static void | removeAllTriggers(Connection
the database connection conn, String the prefix prefix)Remove all triggers that start with the given prefix. |
| public static ResultSet | Returns: the result setthe connection conn, String the search query text, int the maximum number of rows or 0 for no limit limit, int the offset or 0 for no offset offset)Searches from the full text index for this database. |
| protected static ResultSet | Returns: the result setthe database connection conn, String the query text, int the limit limit, int the offset offset, boolean whether the raw data should be returned data)Do the search. |
| public static ResultSet | Returns: the result setthe connection conn, String the search query text, int the maximum number of rows or 0 for no limit limit, int the offset or 0 for no offset offset)Searches from the full text index for this database. |
| protected static void | setColumns(int[]
the column indices (will be modified) index, ArrayList<String> the key list keys, ArrayList<String> the column list columns)Set the column indices of a set of keys. |
| public static void | setIgnoreList(Connection
the connection conn, String the list commaSeparatedList)Change the ignore list. |
| private static void | |
| public static void | setWhitespaceChars(Connection
the connection conn, String the list of characters whitespaceChars)Change the whitespace characters. |
| protected static SQLException | Returns: never returns normallythe message message)Throw a SQLException with the given message. |
| FIELD_COLUMNS | back to summary |
|---|---|
| private static final String FIELD_COLUMNS A column name of the result set returned by the searchData method. | |
| FIELD_KEYS | back to summary |
|---|---|
| private static final String FIELD_KEYS A column name of the result set returned by the searchData method. | |
| FIELD_QUERY | back to summary |
|---|---|
| private static final String FIELD_QUERY The column name of the result set returned by the search method. | |
| FIELD_SCHEMA | back to summary |
|---|---|
| private static final String FIELD_SCHEMA A column name of the result set returned by the searchData method. | |
| FIELD_SCORE | back to summary |
|---|---|
| private static final String FIELD_SCORE The hit score. | |
| FIELD_TABLE | back to summary |
|---|---|
| private static final String FIELD_TABLE A column name of the result set returned by the searchData method. | |
| SCHEMA | back to summary |
|---|---|
| private static final String SCHEMA | |
| SELECT_MAP_BY_WORD_ID | back to summary |
|---|---|
| private static final String SELECT_MAP_BY_WORD_ID | |
| SELECT_ROW_BY_ID | back to summary |
|---|---|
| private static final String SELECT_ROW_BY_ID | |
| TRIGGER_PREFIX | back to summary |
|---|---|
| private static final String TRIGGER_PREFIX | |
| FullText | back to summary |
|---|---|
| public FullText() | |
| addColumnData | back to summary |
|---|---|
| private static void addColumnData(SessionLocal session, ArrayList<String> columns, ArrayList<String> data, Expression expr) | |
| addWords | back to summary |
|---|---|
| protected static void addWords(FullTextSettings setting, Set<String> set, Reader reader) Add all words in the given text to the hash set.
| |
| addWords | back to summary |
|---|---|
| protected static void addWords(FullTextSettings setting, Set<String> set, String text) Add all words in the given text to the hash set.
| |
| asString | back to summary |
|---|---|
| protected static String asString(Object data, int type) throws SQLException INTERNAL. Convert the object to a string.
| |
| closeAll | back to summary |
|---|---|
| public static void closeAll() INTERNAL Close all fulltext settings, freeing up memory. | |
| createIndex | back to summary |
|---|---|
| public static void createIndex(Connection conn, String schema, String table, String columnList) throws SQLException Create a new full text index for a table and column list. Each table may only have one index at any time.
| |
| createOrDropTrigger | back to summary |
|---|---|
| private static void createOrDropTrigger(Connection conn, String schema, String table, boolean create) throws SQLException | |
| createResultSet | back to summary |
|---|---|
| protected static SimpleResultSet createResultSet(boolean data) Create an empty search result and initialize the columns.
| |
| createTrigger | back to summary |
|---|---|
| private static void createTrigger(Connection conn, String schema, String table) throws SQLException Create the trigger.
| |
| dropAll | back to summary |
|---|---|
| public static void dropAll(Connection conn) throws SQLException Drops all full text indexes from the database.
| |
| dropIndex | back to summary |
|---|---|
| public static void dropIndex(Connection conn, String schema, String table) throws SQLException Drop an existing full text index for a table. This method returns silently if no index for this table exists.
| |
| hasChanged | back to summary |
|---|---|
| protected static boolean hasChanged(Object[] oldRow, Object[] newRow, int[] indexColumns) Check if a the indexed columns of a row probably have changed. It may return true even if the change was minimal (for example from 0.0 to 0.00). | |
| indexExistingRows | back to summary |
|---|---|
| private static void indexExistingRows(Connection conn, String schema, String table) throws SQLException Add the existing data to the index.
| |
| init | back to summary |
|---|---|
| public static void init(Connection conn) throws SQLException Initializes full text search functionality for this database. This adds the following Java functions to the database:
CREATE ALIAS IF NOT EXISTS FT_INIT FOR
"org.h2.fulltext.FullText.init";
CALL FT_INIT();
| |
| parseKey | back to summary |
|---|---|
| protected static String[][] parseKey(Connection conn, String key) Parse a primary key condition into the primary key columns.
| |
| quoteSQL | back to summary |
|---|---|
| protected static String quoteSQL(Object data, int type) throws SQLException INTERNAL. Convert an object to a String as used in a SQL statement.
| |
| quoteString | back to summary |
|---|---|
| private static String quoteString(String data) | |
| reindex | back to summary |
|---|---|
| public static void reindex(Connection conn) throws SQLException Re-creates the full text index for this database. Calling this method is usually not needed, as the index is kept up-to-date automatically.
| |
| removeAllTriggers | back to summary |
|---|---|
| protected static void removeAllTriggers(Connection conn, String prefix) throws SQLException Remove all triggers that start with the given prefix.
| |
| search | back to summary |
|---|---|
| public static ResultSet search(Connection conn, String text, int limit, int offset) throws SQLException Searches from the full text index for this database. The returned result set has the following column:
| |
| search | back to summary |
|---|---|
| protected static ResultSet search(Connection conn, String text, int limit, int offset, boolean data) throws SQLException Do the search.
| |
| searchData | back to summary |
|---|---|
| public static ResultSet searchData(Connection conn, String text, int limit, int offset) throws SQLException Searches from the full text index for this database. The result contains the primary key data as an array. The returned result set has the following columns:
| |
| setColumns | back to summary |
|---|---|
| protected static void setColumns(int[] index, ArrayList<String> keys, ArrayList<String> columns) throws SQLException Set the column indices of a set of keys.
| |
| setIgnoreList | back to summary |
|---|---|
| public static void setIgnoreList(Connection conn, String commaSeparatedList) throws SQLException Change the ignore list. The ignore list is a comma separated list of common words that must not be indexed. The default ignore list is empty. If indexes already exist at the time this list is changed, reindex must be called.
| |
| setIgnoreList | back to summary |
|---|---|
| private static void setIgnoreList(FullTextSettings setting, String commaSeparatedList) | |
| setWhitespaceChars | back to summary |
|---|---|
| public static void setWhitespaceChars(Connection conn, String whitespaceChars) throws SQLException Change the whitespace characters. The whitespace characters are used to separate words. If indexes already exist at the time this list is changed, reindex must be called.
| |
| throwException | back to summary |
|---|---|
| protected static SQLException throwException(String message) throws SQLException Throw a SQLException with the given message.
| |
| Modifier and Type | Field and Description |
|---|---|
| private int[] | |
| private static final int | |
| private static final int | |
| private IndexInfo | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private FullTextSettings | |
| private static final String[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private void | |
| public void | fire(Connection
a connection to the database conn, Object[] the old row, or null if no old row is available (for
INSERT) oldRow, Object[] the new row, or null if no new row is available (for
DELETE) newRow)Implements org. INTERNAL |
| private String | |
| private static PreparedStatement | |
| private int[] | |
| public void | init(Connection
a connection to the database (a system connection) conn, String the name of the schema schemaName, String the name of the trigger used in the CREATE TRIGGER
statement triggerName, String the name of the table tableName, boolean whether the fire method is called before or after the
operation is performed before, int the operation type: INSERT, UPDATE, DELETE, SELECT, or a
combination (this parameter is a bit field) type)Overrides default org. INTERNAL |
| private void | |
| public void |
| columnTypes | back to summary |
|---|---|
| private int[] columnTypes | |
| DELETE_MAP | back to summary |
|---|---|
| private static final int DELETE_MAP | |
| DELETE_ROW | back to summary |
|---|---|
| private static final int DELETE_ROW | |
| index | back to summary |
|---|---|
| private IndexInfo index | |
| INSERT_MAP | back to summary |
|---|---|
| private static final int INSERT_MAP | |
| INSERT_ROW | back to summary |
|---|---|
| private static final int INSERT_ROW | |
| INSERT_WORD | back to summary |
|---|---|
| private static final int INSERT_WORD | |
| SELECT_ROW | back to summary |
|---|---|
| private static final int SELECT_ROW | |
| setting | back to summary |
|---|---|
| private FullTextSettings setting | |
| SQL | back to summary |
|---|---|
| private static final String[] SQL | |
| FullTextTrigger | back to summary |
|---|---|
| public FullTextTrigger() | |
| close | back to summary |
|---|---|
| public void close() Overrides default org. INTERNAL
| |
| delete | back to summary |
|---|---|
| private void delete(Connection conn, Object[] row) throws SQLException Delete a row from the index.
| |
| fire | back to summary |
|---|---|
| public void fire(Connection conn, Object[] oldRow, Object[] newRow) throws SQLException Implements org. INTERNAL
| |
| getKey | back to summary |
|---|---|
| private String getKey(Object[] row) throws SQLException | |
| getStatement | back to summary |
|---|---|
| private static PreparedStatement getStatement(Connection conn, int index) throws SQLException | |
| getWordIds | back to summary |
|---|---|
| private int[] getWordIds(Connection conn, Object[] row) throws SQLException | |
| init | back to summary |
|---|---|
| public void init(Connection conn, String schemaName, String triggerName, String tableName, boolean before, int type) throws SQLException Overrides default org. INTERNAL
| |
| insert | back to summary |
|---|---|
| private void insert(Connection conn, Object[] row) throws SQLException Add a row to the index.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default org. INTERNAL
| |