| java.lang.Object org.h2.fulltext.FullText
All known Subclasses: org.h2.fulltext.FullTextLucene,
FullText | public class FullText implements Trigger(Code) | | This class implements the native full text search.
|
Method Summary | |
public 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 SimpleResultSet | createResultSet(boolean data) | public static void | dropAll(Connection conn) Drops all full text indexes from the database. | public void | fire(Connection conn, Object[] oldRow, Object[] newRow) | public static void | init(Connection conn) Initializes full text search functionality for this database. | public void | init(Connection conn, String schemaName, String triggerName, String tableName, boolean before, int type) | protected static Object[][] | parseKey(Connection conn, String key) | public static void | reindex(Connection conn) | public static ResultSet | search(Connection conn, String text, int limit, int offset) Searches from the full text index for this database.
The returned result set has the following column:
- QUERY (varchar): The query to use to get the data.
The query does not include 'SELECT * FROM '.
| public static ResultSet | searchData(Connection conn, String text, int limit, int offset) Searches from the full text index for this database. | public static void | setIgnoreList(Connection conn, String commaSeparatedList) Change the ignore list. |
createIndex | public static void createIndex(Connection conn, String schema, String table, String columnList) throws SQLException(Code) | | Create a new full text index for a table and column list. Each table may
only have one index at any time.
Parameters: conn - the connection Parameters: schema - the schema name of the table Parameters: table - the table name Parameters: columnList - the column list (null for all columns) |
dropAll | public static void dropAll(Connection conn) throws SQLException(Code) | | Drops all full text indexes from the database.
Parameters: conn - the connection |
init | public static void init(Connection conn) throws SQLException(Code) | | Initializes full text search functionality for this database. This adds
the following Java functions to the database:
- FT_CREATE_INDEX(schemaNameString, tableNameString, columnListString)
- FT_SEARCH(queryString, limitInt, offsetInt): result set
- FT_REINDEX()
- FT_DROP_ALL()
It also adds a schema FULLTEXT to the database where bookkeeping
information is stored. This function may be called from a Java
application, or by using the SQL statements:
CREATE ALIAS IF NOT EXISTS FULLTEXT_INIT FOR
"org.h2.fulltext.FullText.init";
CALL FULLTEXT_INIT();
Parameters: conn - the connection |
reindex | public static void reindex(Connection conn) throws SQLException(Code) | | Re-creates the full text index for this database
Parameters: conn - the connection |
search | public static ResultSet search(Connection conn, String text, int limit, int offset) throws SQLException(Code) | | Searches from the full text index for this database.
The returned result set has the following column:
- QUERY (varchar): The query to use to get the data.
The query does not include 'SELECT * FROM '. Example:
PUBLIC.TEST WHERE ID = 1
Parameters: conn - the connection Parameters: text - the search query Parameters: limit - the maximum number of rows or 0 for no limit Parameters: offset - the offset or 0 for no offset the result set |
searchData | public static ResultSet searchData(Connection conn, String text, int limit, int offset) throws SQLException(Code) | | 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:
- SCHEMA (varchar): The schema name. Example: PUBLIC
- TABLE (varchar): The table name. Example: TEST
- COLUMNS (array of varchar): Comma separated list of quoted column
names. The column names are quoted if necessary. Example: (ID)
- KEYS (array of values): Comma separated list of values. Example: (1)
Parameters: conn - the connection Parameters: text - the search query Parameters: limit - the maximum number of rows or 0 for no limit Parameters: offset - the offset or 0 for no offset the result set |
setIgnoreList | public static void setIgnoreList(Connection conn, String commaSeparatedList) throws SQLException(Code) | | 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.
Parameters: conn - the connection Parameters: commaSeparatedList - the list |
|
|