#388

Native substring / "contains" search (n-gram support)

Requested

Submitted August 14, 2026

Convex already has strong full-text search with word tokenization, prefix matching, and relevance ranking. However, it currently lacks efficient support for true substring / "contains" matching. Current limitations:

Full-text search is word-based, so searching for "app" does not reliably match inside "application", "happy", product codes like "XAPP-123", or continuous text without spaces (common in CJK languages). Using .filter() with string includes / contains forces a full table scan and does not scale on larger tables. External solutions (Typesense, Meilisearch, Elasticsearch) add complexity, cost, and break Convex’s reactive consistency.

Requested feature: Native support for efficient substring / contains queries, ideally via n-gram (trigram or configurable n-gram) indexes. This could be:

An option on searchIndex to enable n-gram tokenization A new index type or query method for contains/substring matching Configurable n-gram size

Use cases:

Partial matching on product codes, order IDs, SKUs, usernames, emails Mid-word / infix search and autocomplete CJK and other languages without clear word boundaries Any “does this field contain this substring?” query that needs to be fast and reactive

This would fill an important gap and allow more search workloads to stay fully inside Convex.

Development Updates

No updates yet