#6485·paradedb

Tokenizer names collide when two fields differ only by the trim filter

Author: wankhede04Created Sep 25, 2026Updated Sep 29, 2026
Labelsbugpriority-mediumuser-request

What happens?

Two fields sharing the same base tokenizer but differing only in the trim filter option resolve to the identical registered Tantivy analyzer name, so one field silently gets the other's analyzer instead of its own.

SearchTokenizerFilters::name_suffix() (tokenizers/src/manager.rs) folds every filter field into the string used to build a tokenizer's registration name -- remove_short, remove_long, lowercase, stemmer, stopwords_language, stopwords, alpha_num_only, ascii_folding -- except trim, which was added later (a prior PR) and never wired into this function. Two fields, e.g. pdb.simple (default) and pdb.simple('trim=true'), both resolve to the plain name default and collide in the shared TokenizerManager registry, which is a straightforward keyed insert (register(&search_tokenizer.name(), text_analyzer)).

To Reproduce

sql
CREATE TABLE trim_collision (
    id SERIAL PRIMARY KEY,
    col_default TEXT,
    col_trimmed TEXT
);

CREATE INDEX trim_collision_idx ON trim_collision
USING paradedb (id, (col_default::pdb.simple), (col_trimmed::pdb.simple('trim=true')));

Both columns register under the same tokenizer name (default), so one column's analyzer silently overwrites the other's in the shared registry -- whichever field is registered second wins for both.

OS:

macOS (not OS-specific -- reproduced via a pure-Rust unit test, no live index needed)

ParadeDB Version (e.g. output of SELECT * FROM paradedb.version_info();):

main (current)

Are you using ParadeDB Docker, Helm, or the extension(s) standalone?

ParadeDB pg_search Extension

Full Name:

Vijay Wankhede

Affiliation:

FetchAI

Did you include all relevant data sets for reproducing the issue?

N/A - The reproduction does not require a data set

Did you include the code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configurations (e.g., CPU architecture, PostgreSQL version, Linux distribution) to reproduce the issue?

  • Yes, I have