WITH
clause of CREATE INDEX
.
For instance, the following statement configures an ngram tokenizer for the description
field.
description
and category
fields.
VARCHAR
, TEXT
, UUID
, and their corresponding array types
should be passed to text_fields
.
text_fields
accepts the following keys.
true
.Advanced Options
JSON
and JSONB
should be passed to json_fields
.
json_fields
accepts the following keys.
true
.true
, JSON keys containing a .
will be expanded. For instance, if expand_dots
is true
,
{"metadata.color": "red"}
will be indexed as if it was {"metadata": {"color": "red"}}
.Advanced Options
SMALLINT
, INTEGER
, BIGINT
, OID
, REAL
, DOUBLE PRECISION
, NUMERIC
, and their corresponding array types
should be passed to numeric_fields
.
Advanced Options
true
in order for the field to be
tokenized and searchable.fast
set to true
. Fast fields are also useful for accelerated
scoring and filtering.BOOLEAN
and BOOLEAN[]
should be passed to boolean_fields
.
CREATE_INDEX
accepts several configuration options for boolean_fields
:
Advanced Options
true
in order for the field to be
tokenized and searchable.fast
set to true
. Fast fields are also useful for accelerated
scoring and filtering.DATE
, TIMESTAMP
, TIMESTAMPTZ
, TIME
, TIMETZ
, and their corresponding array types should be passed to datetime_fields
.
CREATE INDEX
accepts several configuration options for datetime_fields
:
Advanced Options
true
in order for the field to be
tokenized and searchable.fast
set to true
. Fast fields are also useful for accelerated
scoring and filtering.numeric_fields
.
Enums should be queried with term queries.
If the ordering of the enum is changed with ADD VALUE ... [ BEFORE | AFTER ]
, the BM25 index should be dropped
and recreated to account for the new enum ordinal values.