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".
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.
|
Thanks for your contribution @trippyogi! We'll take a look and think whether this is the way to go, or we'll plan a more generic way to handle the various dynamic properties supported by |
| header: i18n.t('vectorSearch.indexInfo.column.weight'), | ||
| enableSorting: false, | ||
| }, | ||
| { |
There was a problem hiding this comment.
Nice! One thing worth discussing before we merge - we're currently adding WITHSUFFIXTRIE only, and wiring it in field-by-field (DTO → transformIndexInfo → types → parseIndexAttributes → column). But the backend parser already returns all the other boolean attribute flags generically (SORTABLE, NOSTEM, CASESENSITIVE, UNF, INDEXEMPTY, INDEXMISSING) - the Search page just doesn't surface them yet.
So we have two options:
- Follow-up PR that adds the remaining flags the same way
- Rework this to be dynamic - render the boolean flags from the attribute object directly (one shared cell/column logic) so we don't have to hand-thread each new flag every time RediSearch adds one.
I lean towards (2) since it stops this from being a recurring one-flag-at-a-time chore, but happy to keep this PR scoped and do it separately if you prefer.
Here's an index that uses all the boolean flags at once, so you can see how the table looks with the full set:
FT.CREATE idx:flags ON HASH PREFIX 1 flags: SCHEMA
title TEXT NOSTEM WITHSUFFIXTRIE SORTABLE
body TEXT WITHSUFFIXTRIE INDEXEMPTY INDEXMISSING
name TEXT SORTABLE UNF
tags TAG CASESENSITIVE SORTABLE INDEXEMPTY INDEXMISSING
code TAG NOINDEX
year NUMERIC SORTABLE
This covers every flag in the list - NOSTEM, WITHSUFFIXTRIE, SORTABLE, UNF, CASESENSITIVE, INDEXEMPTY, INDEXMISSING, NOINDEX - across the field types they apply to.
There was a problem hiding this comment.
Thanks for the review and the multi-flag example.
Agreed that hand-wiring each flag doesn’t scale, especially since the API (and Workbench) already handle the full boolean set generically. I’ve drafted a soft proposal that reworks the Search IndexInfo path to render boolean flags dynamically from the attribute object (shared icon cell, columns only when present), instead of special-casing WITHSUFFIXTRIE. Weight is presence-based too for consistency with Workbench.
Compare against the current PR tip:
trippyogi/RedisInsight@fix/6087-withsuffixtrie...fix/6087-dynamic-boolean-columns
(fix/6087-dynamic-boolean-columns - not merged into this PR yet.)
Happy to fold it into this PR if that direction looks right, or adjust column presence/order if you’d rather match Workbench’s key-union order exactly.
There was a problem hiding this comment.
Nice! And thanks for your time and effort 👍
Looks good, so please sync it with the current PR, and we can merge it 🚀
Revert unused attribute list growth per review, and clear prettier/tsc baseline failures from the WITHSUFFIXTRIE tests.
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
Changes FT.INFO attribute parsing shared by API, Workbench, and AI; behavior shifts for alias/flag name collisions but is covered by new unit tests.
Overview
Fixes blank or wrong
WITHSUFFIXTRIEdisplay in Workbench and Search by parsing valuelessFT.INFOattribute flags sequentially (only when a token is a standalone flag), instead ofarray.includes(), which wrongly enabled flags when a field alias was literally namedWITHSUFFIXTRIE.Shared parsing:
convertIndexInfoAttributeReply/convertArrayReplyToObjectmove toredisIndexInfo.ts(withINDEXEMPTY,INDEXMISSING, and related flags); AIcontext.utilre-exports them so Browser, API, and AI stay aligned.API & UI:
IndexAttibuteDtoexposesWITHSUFFIXTRIE,INDEXEMPTY, andINDEXMISSING; WorkbenchparseInfoRawResponseuses the same flag expansion; Vector Search index details add a WITHSUFFIXTRIE column (check/cancel icons) wired from API →useIndexInfo→ table.Reviewed by Cursor Bugbot for commit d762991. Bugbot is set up for automated code reviews on this repo. Configure here.