IBM® Informix® 12.10

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.

Read syntax diagramSkip visual syntax diagram
JSON index parameters for structured text

                                        (1)     
|--+-| The json_names index parameter |-----+------------------->
   |                           (2)          |   
   '-all_json_names=-+-"yes"-+--------------'   
                     '-"no"--'                  

>--+-----------------------------------------------------------------------+-->
   |                              (3)                                      |   
   '-,include_contents=-+-"yes"-+-----+----------------------------------+-'   
                        '-"no"--'     |                              (4) |     
                                      '-,only_json_values=-+-"yes"-+-----'     
                                                           '-"no"--'           

>--+--------------------------------------+--------------------->
   |                                  (5) |   
   '-,json_path_processing=-+-"yes"-+-----'   
                            '-"no"--'         

>--+--------------------------------------------+--------------->
   |                                        (6) |   
   '-+---+-json_array_processing=-+-"yes"-+-----'   
     '-,-'                        '-"no"--'         

>--+------------------------------------------------+-----------|
   |                                            (7) |   
   '-+---+-ignore_json_format_errors=-+-"yes"-+-----'   
     '-,-'                            '-"no"--'         

Notes:
  1. See json_names index parameter.
  2. See all_json_names index parameter.
  3. See include_contents index parameter.
  4. See only_json_values index parameter.
  5. See json_path_processing index parameter.
  6. See json_array_processing index parameter.
  7. See ignore_json_format_errors index parameter.
Read syntax diagramSkip visual syntax diagram
JSON index parameters for unstructured text

|--+---------------------------------+-------------------------->
   |                             (1) |   
   '-only_json_values=-+-"yes"-+-----'   
                       '-"no"--'         

>--+--------------------------------------------+--------------->
   |                                        (2) |   
   '-+---+-json_array_processing=-+-"yes"-+-----'   
     '-,-'                        '-"no"--'         

>--+------------------------------------------------+-----------|
   |                                            (3) |   
   '-+---+-ignore_json_format_errors=-+-"yes"-+-----'   
     '-,-'                            '-"no"--'         

Notes:
  1. See only_json_values index parameter.
  2. See json_array_processing index parameter.
  3. See ignore_json_format_errors index parameter.

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


Examples exchange | Troubleshooting

To find the PDF, see Publications for the IBM Informix 12.10 family of products.
For the release notes, documentation notes, and/or machine notes, see the Release Notes page.