Skip to content

fix: display WITHSUFFIXTRIE for RediSearch text fields#6231

Open
trippyogi wants to merge 4 commits into
redis:mainfrom
trippyogi:fix/6087-withsuffixtrie
Open

fix: display WITHSUFFIXTRIE for RediSearch text fields#6231
trippyogi wants to merge 4 commits into
redis:mainfrom
trippyogi:fix/6087-withsuffixtrie

Conversation

@trippyogi

@trippyogi trippyogi commented Jul 17, 2026

Copy link
Copy Markdown

Summary

  • Treat WITHSUFFIXTRIE (and related valueless flags) as boolean attributes when parsing FT.INFO, so Workbench no longer shows an empty column.
  • Persist and expose the flag through the RediSearch index-info API DTO.
  • Surface WITHSUFFIXTRIE in the Search index details schema table with check/cancel icons (React does not render raw booleans).

Fixes #6087

Test plan

  • Unit: IndexInfo / useIndexInfo / context.util specs passed
  • API: POST /databases/0/redisearch/info returns WITHSUFFIXTRIE: true for chunkText_trie
  • Local Bugbot: fixed blank boolean cell rendering
  • Workbench: FT.INFO idx:trie shows check for WITHSUFFIXTRIE on chunkText_trie
  • Search index details: WITHSUFFIXTRIE column shows check on enabled field

Note

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 WITHSUFFIXTRIE display in Workbench and Search by parsing valueless FT.INFO attribute flags sequentially (only when a token is a standalone flag), instead of array.includes(), which wrongly enabled flags when a field alias was literally named WITHSUFFIXTRIE.

Shared parsing: convertIndexInfoAttributeReply / convertArrayReplyToObject move to redisIndexInfo.ts (with INDEXEMPTY, INDEXMISSING, and related flags); AI context.util re-exports them so Browser, API, and AI stay aligned.

API & UI: IndexAttibuteDto exposes WITHSUFFIXTRIE, INDEXEMPTY, and INDEXMISSING; Workbench parseInfoRawResponse uses 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.

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.
@trippyogi
trippyogi marked this pull request as ready for review July 17, 2026 20:50
@trippyogi
trippyogi requested a review from a team as a code owner July 17, 2026 20:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread redisinsight/api/src/modules/browser/utils/redisIndexInfo.ts Outdated
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.
@valkirilov

Copy link
Copy Markdown
Member

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 FT.INFO, so we don't limit the fix to only adding support for WITHSUFFIXTRIE. Keep your PR open, we'll check back later, thanks 🙂

Comment thread redisinsight/ui/src/packages/redisearch/src/constants/constants.ts Outdated
header: i18n.t('vectorSearch.indexInfo.column.weight'),
enableSorting: false,
},
{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Follow-up PR that adds the remaining flags the same way
  2. 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.

Image

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Redis Insight does not display WITHSUFFIXTRIE for Redis Search text fields

2 participants