fix: display WITHSUFFIXTRIE for RediSearch text fields#6231
Conversation
Parse and surface the WITHSUFFIXTRIE boolean flag in Workbench FT.INFO results and Search index details so Redis Insight matches FT.INFO. Fixes redis#6087
Boolean table cells were blank because React does not render true/false as text. Match Workbench FT.INFO boolean columns with check/cancel icons.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b1e9ccb46
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| attribute['WITHSUFFIXTRIE'] = | ||
| input.includes('WITHSUFFIXTRIE') || undefined; | ||
| attribute['INDEXEMPTY'] = input.includes('INDEXEMPTY') || undefined; | ||
| attribute['INDEXMISSING'] = input.includes('INDEXMISSING') || undefined; |
There was a problem hiding this comment.
Avoid matching option names inside field identifiers
When a schema field or alias is literally WITHSUFFIXTRIE (for example a HASH field named that, or a JSON field using AS WITHSUFFIXTRIE) but the option was not enabled, input.includes('WITHSUFFIXTRIE') still marks the returned attribute as having suffix trie enabled because it scans both keys and values from the FT.INFO attribute array. That makes the API/UI report a checkmark for a configuration the index does not have; the same false positive applies to the newly added INDEXEMPTY/INDEXMISSING checks, so the parser needs to distinguish standalone option tokens from identifier/attribute values.
Useful? React with 👍 / 👎.
Avoid includes()-style matches that false-positive when a field alias is literally named WITHSUFFIXTRIE (or NOSTEM/SORTABLE/etc). Align Workbench, Browser API, and AI context parsers on the same key-position walk.
Summary
WITHSUFFIXTRIE(and related valueless flags) as boolean attributes when parsingFT.INFO, so Workbench no longer shows an empty column.WITHSUFFIXTRIEin the Search index details schema table with check/cancel icons (React does not render raw booleans).Fixes #6087
Test plan
POST /databases/0/redisearch/inforeturnsWITHSUFFIXTRIE: trueforchunkText_trieFT.INFO idx:trieshows check for WITHSUFFIXTRIE onchunkText_trieNote
Medium Risk
Centralized FT.INFO attribute parsing affects Workbench, API, AI context, and Search index UI; incorrect parsing could misrepresent index schema, though scope is display/metadata rather than data writes.
Overview
Fixes blank or wrong RediSearch index flags (notably
WITHSUFFIXTRIE) by changing howFT.INFOattribute arrays are parsed: valueless flags are recognized only as standalone tokens in key position, not viaarray.includes(), so an attribute alias literally namedWITHSUFFIXTRIEno longer enables the flag by mistake.Shared parsing:
convertIndexInfoAttributeReply/convertArrayReplyToObjectlive inredisIndexInfo.ts(withWITHSUFFIXTRIE,INDEXEMPTY,INDEXMISSINGadded to the flag set); AI query context re-exports them so Browser and AI stay aligned. The index-info API DTO exposes the new boolean fields.UI: Workbench
parseInfoRawResponseuses the same sequentialexpandBooleanAttributeFlagslogic. Vector Search index details add a WITHSUFFIXTRIE column (check/cancel icons) wired from API →useIndexInfo→ table. Tests cover alias-vs-flag edge cases on API and UI parsers.Reviewed by Cursor Bugbot for commit e64bd1a. Bugbot is set up for automated code reviews on this repo. Configure here.