analyzer index parameter
When you create a bts index, you can include the analyzer index parameter to set the default analyzer and any specific analyzers for specific fields.
Element | Description |
---|---|
analyzer | The name of the analyzer. Possible values:
|
column | The name of the column that contains analyzer assignments. |
directory | The path for the analyzer assignments file. |
field | The XML tag, path, or the column name that is indexed. |
filename | The name of the file that contains analyzer assignments. |
table | The name of the table that contains analyzer assignments. |
Usage
To use the same analyzer for all fields or columns that are indexed when you create the bts index, include the analyzer name without a field name. To use more than one analyzer, enclose multiple analyzer and field pairs in parentheses. To use one analyzer for most fields but other analyzers for specific fields, list the first analyzer without a field and the other analyzers with fields. The first analyzer is used for all fields except the ones that are explicitly listed with analyzer assignments.
You can specify the list of analyzers by field in a table column or in a file. The file or table must be readable by the user who creates the index. Separate the field name and analyzer pairs in the file or table by commas, white spaces, new lines, or a combination of those separators. The file or table becomes read-only when the index is created. If you want to add or change analyzer assignments, you must drop and re-create the index.
Examples
CREATE INDEX desc_idx ON products (brands bts_char_ops)
USING bts (analyzer="cjk") IN sbsp1;
The following example creates a bts index on two XML fields and uses a different analyzer for each field:
CREATE INDEX boats_bts
ON boats(xml_data bts_lvarchar_ops)
USING bts
(
xmltags="(skipper,boatname)" ,
analyzer="(skipper:soundex,boatname:snowball)"
)
IN bts_sbspace;