| Modifier and Type | Class and Description |
|---|---|
| public static class | FullTextLucene.
Trigger updates the index when a inserting, updating, or deleting a row. |
| private static class | FullTextLucene.
A wrapper for the Lucene writer and searcher. |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | IN_MEMORY_PREFIX
The prefix for a in-memory path. |
| private static final HashMap | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| protected static final boolean | STORE_DOCUMENT_TEXT_IN_INDEX
Whether the text content should be stored in the Lucene index. |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected static SQLException | Returns: the converted SQL exceptionthe original exception e)Convert an exception to a fulltext exception. |
| 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)Hides org. Create a new full text index for a table and column list. |
| private static void | createOrDropTrigger(Connection conn, String schema, String table, boolean create)
Hides org.
|
| private static void | createTrigger(Connection
the database connection conn, String the schema name schema, String the table name table)Hides org. Create the trigger. |
| public static void | dropAll(Connection
the connection conn)Hides org. Drops all full text indexes from the database. |
| 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)Hides org. Drop an existing full text index for a table. |
| protected static FullTextLucene. | Returns: the index access wrapperthe connection conn)Get the index writer/searcher wrapper for the given connection. |
| protected static String | Returns: the paththe database connection conn)Get the path of the Lucene index for this database. |
| private static void | indexExistingRows(Connection
the database connection conn, String the schema name schema, String the table name table)Hides org. Add the existing data to the index. |
| public static void | init(Connection
the connection conn)Hides org. Initializes full text search functionality for this database. |
| public static void | reindex(Connection
the connection conn)Hides org. Re-creates the full text index for this database. |
| protected static void | removeIndexAccess(String
the index path indexPath)Close the index writer and searcher and remove them from the index access set. |
| private static void | |
| 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)Hides org. 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)Hides org. 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)Hides org. Searches from the full text index for this database. |
| IN_MEMORY_PREFIX | back to summary |
|---|---|
| private static final String IN_MEMORY_PREFIX The prefix for a in-memory path. This prefix is only used internally within this class and not related to the database URL. | |
| INDEX_ACCESS | back to summary |
|---|---|
| private static final HashMap<String, FullTextLucene. | |
| LUCENE_FIELD_COLUMN_PREFIX | back to summary |
|---|---|
| private static final String LUCENE_FIELD_COLUMN_PREFIX | |
| LUCENE_FIELD_DATA | back to summary |
|---|---|
| private static final String LUCENE_FIELD_DATA | |
| LUCENE_FIELD_MODIFIED | back to summary |
|---|---|
| private static final String LUCENE_FIELD_MODIFIED | |
| LUCENE_FIELD_QUERY | back to summary |
|---|---|
| private static final String LUCENE_FIELD_QUERY | |
| SCHEMA | back to summary |
|---|---|
| private static final String SCHEMA | |
| STORE_DOCUMENT_TEXT_IN_INDEX | back to summary |
|---|---|
| protected static final boolean STORE_DOCUMENT_TEXT_IN_INDEX Whether the text content should be stored in the Lucene index. | |
| TRIGGER_PREFIX | back to summary |
|---|---|
| private static final String TRIGGER_PREFIX | |
| FullTextLucene | back to summary |
|---|---|
| public FullTextLucene() | |
| convertException | back to summary |
|---|---|
| protected static SQLException convertException(Exception e) Convert an exception to a fulltext exception.
| |
| createIndex | back to summary |
|---|---|
| public static void createIndex(Connection conn, String schema, String table, String columnList) throws SQLException Hides org. 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 | |
| createTrigger | back to summary |
|---|---|
| private static void createTrigger(Connection conn, String schema, String table) throws SQLException Hides org. Create the trigger.
| |
| dropAll | back to summary |
|---|---|
| public static void dropAll(Connection conn) throws SQLException Hides org. Drops all full text indexes from the database.
| |
| dropIndex | back to summary |
|---|---|
| public static void dropIndex(Connection conn, String schema, String table) throws SQLException Hides org. Drop an existing full text index for a table. This method returns silently if no index for this table exists.
| |
| getIndexAccess | back to summary |
|---|---|
| protected static FullTextLucene. Get the index writer/searcher wrapper for the given connection.
| |
| getIndexPath | back to summary |
|---|---|
| protected static String getIndexPath(Connection conn) throws SQLException Get the path of the Lucene index for this database.
| |
| indexExistingRows | back to summary |
|---|---|
| private static void indexExistingRows(Connection conn, String schema, String table) throws SQLException Hides org. Add the existing data to the index.
| |
| init | back to summary |
|---|---|
| public static void init(Connection conn) throws SQLException Hides org. Initializes full text search functionality for this database. This adds the following Java functions to the database:
CREATE ALIAS IF NOT EXISTS FTL_INIT FOR
"org.h2.fulltext.FullTextLucene.init";
CALL FTL_INIT();
| |
| reindex | back to summary |
|---|---|
| public static void reindex(Connection conn) throws SQLException Hides org. 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.
| |
| removeIndexAccess | back to summary |
|---|---|
| protected static void removeIndexAccess(String indexPath) throws SQLException Close the index writer and searcher and remove them from the index access set.
| |
| removeIndexFiles | back to summary |
|---|---|
| private static void removeIndexFiles(Connection conn) throws SQLException | |
| search | back to summary |
|---|---|
| public static ResultSet search(Connection conn, String text, int limit, int offset) throws SQLException Hides org. 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 Hides org. Do the search.
| |
| searchData | back to summary |
|---|---|
| public static ResultSet searchData(Connection conn, String text, int limit, int offset) throws SQLException Hides org. 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:
| |
| Modifier and Type | Field and Description |
|---|---|
| private String[] | |
| private int[] | |
| private final org. | |
| private FullTextLucene. | |
| private int[] | |
| private String | |
| private int[] | |
| private String | |
| private String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| pack-priv 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 | |
| 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 |
| pack-priv void |
| columns | back to summary |
|---|---|
| private String[] columns | |
| columnTypes | back to summary |
|---|---|
| private int[] columnTypes | |
| DOC_ID_FIELD_TYPE | back to summary |
|---|---|
| private final org. | |
| indexAccess | back to summary |
|---|---|
| private FullTextLucene. | |
| indexColumns | back to summary |
|---|---|
| private int[] indexColumns | |
| indexPath | back to summary |
|---|---|
| private String indexPath | |
| keys | back to summary |
|---|---|
| private int[] keys | |
| schema | back to summary |
|---|---|
| private String schema | |
| table | back to summary |
|---|---|
| private String table | |
| FullTextTrigger | back to summary |
|---|---|
| public FullTextTrigger() | |
| close | back to summary |
|---|---|
| public void close() throws SQLException Overrides default org. INTERNAL
| |
| commitIndex | back to summary |
|---|---|
| pack-priv void commitIndex() throws SQLException Commit all changes to the Lucene index.
| |
| delete | back to summary |
|---|---|
| private void delete(Object[] row, boolean commitIndex) 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
| |
| getQuery | back to summary |
|---|---|
| private String getQuery(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 |
|---|---|
| pack-priv void insert(Object[] row, boolean commitIndex) throws SQLException Add a row to the index.
| |
| Modifier and Type | Field and Description |
|---|---|
| private org. | searcher
The index searcher. |
| pack-priv final org. | writer
The index writer. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | |
| public synchronized void | |
| pack-priv synchronized org. | |
| private void | |
| pack-priv synchronized void |
| searcher | back to summary |
|---|---|
| private org. The index searcher. | |
| writer | back to summary |
|---|---|
| pack-priv final org. The index writer. | |
| IndexAccess | back to summary |
|---|---|
| pack-priv IndexAccess(org. | |
| close | back to summary |
|---|---|
| public synchronized void close() throws IOException Close the index.
| |
| commit | back to summary |
|---|---|
| public synchronized void commit() throws IOException Commit the changes.
| |
| getSearcher | back to summary |
|---|---|
| pack-priv synchronized org. Start using the searcher.
| |
| initializeSearcher | back to summary |
|---|---|
| private void initializeSearcher() throws IOException | |
| returnSearcher | back to summary |
|---|---|
| pack-priv synchronized void returnSearcher(org. Stop using the searcher.
| |