Note
For OceanBase Database V4.4.2, full-text indexes are supported in Oracle-compatible mode starting from V4.4.2 BP2.
OceanBase Database supports the full-text index feature in Oracle-compatible mode, allowing for efficient full-text searches on columns of the TEXT type. Full-text indexes can significantly improve the query performance of keyword search operations.
Columns that support full-text indexes
In OceanBase Database's Oracle-compatible mode, full-text indexes can be applied to columns of the CHAR, VARCHAR, VARCHAR2, NCHAR, NVARCHAR2, and CLOB types.
Data types |
Storage features |
Application scenarios |
|---|---|---|
| CHAR(n) | Fixed-length string, padded with spaces if insufficient | Fixed-length encoding, IDs, etc. |
| VARCHAR(n) | Variable-length string | For general variable-length texts, this is effectively equivalent toVARCHAR2 |
| VARCHAR2(n) | Variable-length string | Recommended for general text fields |
| NCHAR(n) | Fixed-length national character set string | Multi-language fixed-length fields |
| NVARCHAR2(n) | Variable-length national character set string | Multi-language variable-length text (such as Chinese and Japanese) |
| CLOB | Large object text, supporting massive character counts | Very Long Text (Articles, Logs, JSON Text, etc.) |
Tokenizers supported by full-text indexes
OceanBase Database's full-text index feature supports a variety of built-in tokenizers, helping users select the optimal text segmentation strategy based on their business scenarios. When creating a full-text index, you can specify a tokenizer by setting PARAMETERS('LEXER parser_name'). The following table lists the tokenizers supported by OceanBase Database:
- SPACE (default)
- NGRAM
- NGRAM2
- IK
- BENG
For detailed information on how to choose a tokenizer, see the Tokenizers section in Full-text index.
References
For more information about creating full-text indexes, see the Create a full-text index section in Create an index.
