only_json_values index parameter
Enable the only_json_values index parameter to index only the values in the JSON or BSON documents as unstructured text. The field names are not indexed.
You can index both field name-value pairs and values,
but not field names, as unstructured text. The json_names or all_json_names index
parameter enables the indexing of field name-value pairs. The include_contents index
parameter enables the indexing of field names and values as unstructured
text. Add the only_json_values index parameter
to modify the behavior of the include_contents index
parameter to omit field names from the contents
field.
Example: Index values as unstructured text
The following statement creates a bts index with the only_json_values index parameter enabled on the example JSON docs column:
create index bts_idx
on json_tab (docs bts_json_ops)
using bts(only_json_values="yes");
The
resulting index indexes the following unstructured text that contains
only the values in the document in the contents
field:
contents: jim flynn 29 dodge olds slim flynn lynn
Example: Index all field name-value pairs and values as unstructured text
The following statement creates a bts index with the all_json_names, only_json_values, and include_contents index parameters enabled on the example JSON docs column:
create index bts_idx
on json_tab (docs bts_json_ops)
using bts(
all_json_names="yes",
include_contents="yes",
only_json_values="yes");
The resulting
index contains the following 9 field name-value pairs and the values
as unstructured text in the contents
field:
givenname: jim
givenname: slim
givenname: lynn
age: 29
cars: dodge
cars: olds
surname: flynn
surname: flynn
surname: kim
contents: jim flynn 29 dodge olds slim flynn lynn kim