You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Semantic cache — RediSearch vector search fails ("Syntax error") for TAG values containing ":" (escapeSearchValue omits ":" and other special chars) #5333
I have searched existing issues and discussions to avoid duplicates
I am using the latest version (or have tested against main/nightly)
Description
When the semantic cache runs a vector search and a metadata TAG filter value contains a colon : — e.g. the model name (cache_by_model: true) for Ollama/vLLM names like gemma31b-q6:latest — the FT.SEARCH is rejected and the plugin logs semantic search skipped. Semantic matching then silently never fires; every request falls through and is stored fresh. Direct (hash) caching still works, so it's easy to miss.
Root cause: framework/vectorstore/redis.go → escapeSearchValue() escapes a subset of RediSearch specials but omits : (and ; / < > = + ).
For a TAG query @field:{value} at DIALECT 2, an unescaped : is a syntax error.
Model IDs commonly contain : (:latest, :q6_K) and / (provider-prefixed).
Steps to reproduce
FT.CREATE testidx PREFIX 1 td: SCHEMA model TAG
HSET td:1 model "gemma31b-q6:latest"
FT.SEARCH testidx "@model:{gemma31b-q6:latest}" DIALECT 2 # current output -> Syntax error near gemma31b-q6
FT.SEARCH testidx "@model:{gemma31b-q6:latest}" DIALECT 2 # colon escaped -> 1) td:1 (works)
Expected behavior
semantic search runs; similar prompt returns a cached (semantic) hit.
Actual behavior
native vector search failed: Syntax error at offset N near ; semantic search skipped; never a semantic hit for such model/tag values.
Affected area(s)
Framework
Version
framework v1.5.1 (built from source @ c0909f9; gateway ~v2.1.28)
Hi @mann1x, reproduced this issue and opened a PR for it.
Replaced the blocklist with an allowlist. Every ASCII char that isn't alphanumeric or underscore gets escaped; non-ASCII passes through. No list to keep in sync with RedisSearch's grammar anymore.
Activity
AdityaPainuli commentedon Jul 18, 2026
Hi @mann1x, reproduced this issue and opened a PR for it.
Replaced the blocklist with an allowlist. Every ASCII char that isn't alphanumeric or underscore gets escaped; non-ASCII passes through. No list to keep in sync with RedisSearch's grammar anymore.