JSON index parameters syntax

You can use JSON index parameters to index the contents of JSON and BSON columns as structured or unstructured text, or both.

Include JSON index parameters in the bts index definition when you create the bts index. See bts access method syntax. You can also create a bts index on a BSON column by running the HCL OneDB™ JSON createTextIndex command. Both methods requires the same syntax for JSON and other bts index parameters.

You can index JSON or BSON documents as structured or unstructured text.

JSON index parameters for structured text

1 %The json_names index parameter(1)
1 all_json_names=
2.1 "yes"
2.1 "no"(2)
2? , include_contents=
3.1 "yes"
3.1 "no"(3)
2?, only_json_values=
3.1 "yes"
3.1 "no"(4)
2? , json_path_processing=
3.1 "yes"
3.1 "no"(5)
2? ?,json_array_processing=
3.1 "yes"
3.1 "no"(6)
2? ?,ignore_json_format_errors=
3.1 "yes"
3.1 "no"(7)
JSON index parameters for unstructured text

1? only_json_values=
2.1 "yes"
2.1 "no"(1)? ?,json_array_processing=
2.1 "yes"
2.1 "no"(2)? ?,ignore_json_format_errors=
2.1 "yes"
2.1 "no"(3)

Usage

If you do not include any JSON index parameters when you create a bts index on a JSON or BSON column, both the field names and the values are indexed together as unstructured text.

Include a comma between parameters.

Example

The following statement creates a bts index without JSON index parameters on the example JSON docs column:

CREATE INDEX bts_idx
         ON json_tab (docs bts_json_ops)
         USING bts;

The resulting index contains the following unstructured text that is based on the tree representation of the document in the contents field:

contents: person givenname jim surname flynn age 29 cars dodge olds parents 
givenname slim surname flynn givenname lynn surname kim