public class FullTextLucene extends FullText
Modifier and Type | Class and Description |
---|---|
static class |
FullTextLucene.FullTextTrigger
Trigger updates the index when a inserting, updating, or deleting a row.
|
Modifier and Type | Field and Description |
---|---|
protected static boolean |
STORE_DOCUMENT_TEXT_IN_INDEX
Whether the text content should be stored in the Lucene index.
|
Constructor and Description |
---|
FullTextLucene() |
Modifier and Type | Method and Description |
---|---|
protected static SQLException |
convertException(Exception e)
Convert an exception to a fulltext exception.
|
static void |
createIndex(Connection conn,
String schema,
String table,
String columnList)
Create a new full text index for a table and column list.
|
protected static void |
createTrigger(Connection conn,
String schema,
String table)
Create the trigger.
|
static void |
dropAll(Connection conn)
Drops all full text indexes from the database.
|
protected static org.h2.fulltext.FullTextLucene.IndexAccess |
getIndexAccess(Connection conn)
Get the index writer/searcher wrapper for the given connection.
|
protected static String |
getIndexPath(Connection conn)
Get the path of the Lucene index for this database.
|
protected static void |
indexExistingRows(Connection conn,
String schema,
String table)
Add the existing data to the index.
|
static void |
init(Connection conn)
Initializes full text search functionality for this database.
|
static void |
reindex(Connection conn)
Re-creates the full text index for this database.
|
protected static void |
removeIndexAccess(org.h2.fulltext.FullTextLucene.IndexAccess access,
String indexPath)
Close the index writer and searcher and remove them from the index access set.
|
static ResultSet |
search(Connection conn,
String text,
int limit,
int offset)
Searches from the full text index for this database.
|
protected static ResultSet |
search(Connection conn,
String text,
int limit,
int offset,
boolean data)
Do the search.
|
static ResultSet |
searchData(Connection conn,
String text,
int limit,
int offset)
Searches from the full text index for this database.
|
addWords, addWords, asString, closeAll, createResultSet, dropIndex, hasChanged, parseKey, quoteSQL, removeAllTriggers, setColumns, setIgnoreList, setWhitespaceChars, throwException
protected static final boolean STORE_DOCUMENT_TEXT_IN_INDEX
public static void init(Connection conn) throws SQLException
CREATE ALIAS IF NOT EXISTS FTL_INIT FOR "org.h2.fulltext.FullTextLucene.init"; CALL FTL_INIT();
conn
- the connectionSQLException
public static void createIndex(Connection conn, String schema, String table, String columnList) throws SQLException
conn
- the connectionschema
- the schema name of the table (case sensitive)table
- the table name (case sensitive)columnList
- the column list (null for all columns)SQLException
public static void reindex(Connection conn) throws SQLException
conn
- the connectionSQLException
public static void dropAll(Connection conn) throws SQLException
conn
- the connectionSQLException
public static ResultSet search(Connection conn, String text, int limit, int offset) throws SQLException
conn
- the connectiontext
- the search querylimit
- the maximum number of rows or 0 for no limitoffset
- the offset or 0 for no offsetSQLException
public static ResultSet searchData(Connection conn, String text, int limit, int offset) throws SQLException
conn
- the connectiontext
- the search querylimit
- the maximum number of rows or 0 for no limitoffset
- the offset or 0 for no offsetSQLException
protected static SQLException convertException(Exception e)
e
- the original exceptionprotected static void createTrigger(Connection conn, String schema, String table) throws SQLException
conn
- the database connectionschema
- the schema nametable
- the table nameSQLException
protected static org.h2.fulltext.FullTextLucene.IndexAccess getIndexAccess(Connection conn) throws SQLException
conn
- the connectionSQLException
protected static String getIndexPath(Connection conn) throws SQLException
conn
- the database connectionSQLException
protected static void indexExistingRows(Connection conn, String schema, String table) throws SQLException
conn
- the database connectionschema
- the schema nametable
- the table nameSQLException
protected static void removeIndexAccess(org.h2.fulltext.FullTextLucene.IndexAccess access, String indexPath) throws SQLException
access
- the index writer/searcher wrapperindexPath
- the index pathSQLException
protected static ResultSet search(Connection conn, String text, int limit, int offset, boolean data) throws SQLException
conn
- the database connectiontext
- the querylimit
- the limitoffset
- the offsetdata
- whether the raw data should be returnedSQLException
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.