|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.fulltext.FullText
public class FullText
This class implements the native full text search. Most methods can be called using SQL statements as well.
Nested Class Summary | |
---|---|
static class |
FullText.FullTextTrigger
Trigger updates the index when a inserting, updating, or deleting a row. |
Constructor Summary | |
---|---|
FullText()
|
Method Summary | |
---|---|
protected static java.lang.String |
asString(java.lang.Object data,
int type)
INTERNAL. |
static void |
createIndex(java.sql.Connection conn,
java.lang.String schema,
java.lang.String table,
java.lang.String columnList)
Create a new full text index for a table and column list. |
protected static SimpleResultSet |
createResultSet(boolean data)
Create an empty search result and initialize the columns. |
static void |
dropAll(java.sql.Connection conn)
Drops all full text indexes from the database. |
static void |
dropIndex(java.sql.Connection conn,
java.lang.String schema,
java.lang.String table)
Drop an existing full text index for a table. |
static void |
init(java.sql.Connection conn)
Initializes full text search functionality for this database. |
protected static java.lang.Object[][] |
parseKey(java.sql.Connection conn,
java.lang.String key)
Parse a primary key condition into the primary key columns. |
protected static java.lang.String |
quoteSQL(java.lang.Object data,
int type)
INTERNAL. |
static void |
reindex(java.sql.Connection conn)
Re-creates the full text index for this database |
protected static void |
removeAllTriggers(java.sql.Connection conn,
java.lang.String prefix)
Remove all triggers that start with the given prefix. |
static java.sql.ResultSet |
search(java.sql.Connection conn,
java.lang.String text,
int limit,
int offset)
Searches from the full text index for this database. |
static java.sql.ResultSet |
searchData(java.sql.Connection conn,
java.lang.String text,
int limit,
int offset)
Searches from the full text index for this database. |
protected static void |
setColumns(int[] index,
java.util.ArrayList<java.lang.String> keys,
java.util.ArrayList<java.lang.String> columns)
Set the column indices of a set of keys. |
static void |
setIgnoreList(java.sql.Connection conn,
java.lang.String commaSeparatedList)
Change the ignore list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FullText()
Method Detail |
---|
public static void init(java.sql.Connection conn) throws java.sql.SQLException
CREATE ALIAS IF NOT EXISTS FT_INIT FOR "org.h2.fulltext.FullText.init"; CALL FT_INIT();
conn
- the connection
java.sql.SQLException
public static void createIndex(java.sql.Connection conn, java.lang.String schema, java.lang.String table, java.lang.String columnList) throws java.sql.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)
java.sql.SQLException
public static void reindex(java.sql.Connection conn) throws java.sql.SQLException
conn
- the connection
java.sql.SQLException
public static void dropIndex(java.sql.Connection conn, java.lang.String schema, java.lang.String table) throws java.sql.SQLException
conn
- the connectionschema
- the schema name of the table (case sensitive)table
- the table name (case sensitive)
java.sql.SQLException
public static void dropAll(java.sql.Connection conn) throws java.sql.SQLException
conn
- the connection
java.sql.SQLException
public static java.sql.ResultSet search(java.sql.Connection conn, java.lang.String text, int limit, int offset) throws java.sql.SQLException
conn
- the connectiontext
- the search querylimit
- the maximum number of rows or 0 for no limitoffset
- the offset or 0 for no offset
java.sql.SQLException
public static java.sql.ResultSet searchData(java.sql.Connection conn, java.lang.String text, int limit, int offset) throws java.sql.SQLException
conn
- the connectiontext
- the search querylimit
- the maximum number of rows or 0 for no limitoffset
- the offset or 0 for no offset
java.sql.SQLException
public static void setIgnoreList(java.sql.Connection conn, java.lang.String commaSeparatedList) throws java.sql.SQLException
conn
- the connectioncommaSeparatedList
- the list
java.sql.SQLException
protected static java.lang.String asString(java.lang.Object data, int type) throws java.sql.SQLException
data
- the objecttype
- the SQL type
java.sql.SQLException
protected static SimpleResultSet createResultSet(boolean data) throws java.sql.SQLException
data
- true if the result set should contain the primary key data as
an array.
java.sql.SQLException
protected static java.lang.Object[][] parseKey(java.sql.Connection conn, java.lang.String key) throws java.sql.SQLException
conn
- the database connectionkey
- the primary key condition as a string
java.sql.SQLException
protected static java.lang.String quoteSQL(java.lang.Object data, int type) throws java.sql.SQLException
data
- the objecttype
- the SQL type
java.sql.SQLException
protected static void removeAllTriggers(java.sql.Connection conn, java.lang.String prefix) throws java.sql.SQLException
conn
- the database connectionprefix
- the prefix
java.sql.SQLException
protected static void setColumns(int[] index, java.util.ArrayList<java.lang.String> keys, java.util.ArrayList<java.lang.String> columns) throws java.sql.SQLException
index
- the column indices (will be modified)keys
- the key listcolumns
- the column list
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |