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 Informix® 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

{ <The json_names index parameter> (explicit id ) | all_json_names= { "yes" | "no" } (explicit id ) }
[ , include_contents = { "yes" | "no" } (explicit id ) [ , only_json_values = { "yes" | "no" } (explicit id ) ] ]
[ , json_path_processing = { "yes" | "no" } (explicit id ) ]
[ , json_array_processing= { "yes" | "no" } (explicit id ) ]
[ , ignore_json_format_errors= { "yes" | "no" } (explicit id ) ]

JSON index parameters for unstructured text

[ only_json_values= { "yes" | "no" } (explicit id ) ]
[ , json_array_processing= { "yes" | "no" } (explicit id ) ]
[ , ignore_json_format_errors= { "yes" | "no" } (explicit id ) ]

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