multi_delimiter
The multi_delimiter template splits the input wherever it encounters any of several delimiter characters, given as the DELIMITERS list. It suits fields that mix separators — for example splitting key:value; key2:value2 on :, ; and space yields the individual keys and values.
Apart from accepting a set of delimiters rather than one, it behaves like delimiter: it emits the pieces verbatim, so chain it into a pipeline if you also need case folding or stemming.
Options
| Option | Type | Default | Description |
|---|---|---|---|
DELIMITERS | string list | required | Comma-separated delimiters (e.g., '":", ";", " "') |
Tokenization
The template cuts the input wherever it finds any character in the DELIMITERS set and emits the pieces verbatim — no further analysis. It behaves like delimiter but accepts several separators at once, which suits fields that mix them.
| Input | Delimiters | Tokens |
|---|---|---|
key:value; key2:value2 | : ; space | {key,value,key2,value2} |
2026-06-18 logs/app | / - space | {2026,06,18,logs,app} |
Splitting key:value; key2:value2 on the colon, semicolon and space separators recovers the individual keys and values in one pass. Preview the split with ts_lexize:
CREATE TEXT SEARCH DICTIONARY tok_multi_delim ( template = 'multi_delimiter', delimiters = '":", ";", " "');
SELECT ts_lexize('tok_multi_delim', 'key:value; key2:value2'); ts_lexize------------------------- {key,value,key2,value2}Examples
CREATE TEXT SEARCH DICTIONARY multi_delim ( template = 'multi_delimiter', delimiters = '":", ";", " ", ".", "|"');Because the delimiter list is itself comma-separated, a comma cannot be used as a delimiter here. To split on a single comma, use the delimiter template instead.
See also
- delimiter — split on a single delimiter
- CREATE TEXT SEARCH DICTIONARY