RI-8171 Create index when no data exists#6195
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1813fa1a5
ℹ️ 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".
Code Coverage - Frontend unit tests
Test suite run success7769 tests passing in 860 suites. Report generated by 🧪jest coverage report action from 96f8b9d |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a4336a2807
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c46018a60
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 44b7cd2d09
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63150970f0
ℹ️ 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".
Renames the welcome screen "Use data from my database" button to "Create index" and removes the guard that disabled it when the database has no Hash/JSON keys. When no keys exist, the create-index page hides the key browser panel and switches to manual creation: an empty index definition panel with guidance, where the user adds fields, an index name, and a prefix themselves. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…x flow The existing-keys probe scanned with scanThreshold: 1, so it gave up after the first scanned key — reporting "no keys" whenever a non-Hash/ JSON key happened to come first in scan order. That wrongly sent users with data into manual creation and kept the list-page "Use existing data" menu item disabled. Scan with the user-configured threshold instead, and drop the now-obsolete disabled guard from the menu. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…mode Manual creation required a non-empty index prefix, but the only feedback was a hover tooltip on the disabled button — adding a field appeared to do nothing. Drop the hard requirement to match the browse flow, where an empty prefix (index all keys) is already allowed. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ys probe Drop the client-supplied scanThreshold — the keys endpoint already caps scanning with its configured default. Scan with SCAN_COUNT_DEFAULT instead of count: 1, since the backend derives the per-iteration SCAN COUNT from it; probing key-by-key could take thousands of round trips on databases with no Hash/JSON keys. Also replace the `;(... as jest.Mock)` cast with jest.mocked() in the create-index page spec. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ation References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A failed or partially failed existing-keys probe reported hasKeys=false, which the create-index page treated as a confirmed empty database and hid the key browser. Expose an error flag from the probe and only enter manual creation on a successful "no keys" result. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The existing-keys probe re-runs on route changes and flipped loading back to true, which unmounted the create-index page (and any form state) behind a full-page loader. Report loading only for the initial check; re-checks refresh the result silently. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
With no key to derive the type from, manual creation was locked to FT.CREATE ... ON HASH. Add a HASH/JSON toggle to the toolbar so JSON indexes can be pre-created on an empty database. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
In manual mode with no fields the content area always shows the guidance panel, so switching between Table and Command view had no visible effect. Disable the toggle until the first field is added. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Instead of disabling the view toggle before any fields are added, render the (empty) command view when the Command tab is selected. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The keys endpoint returns one scan result per cluster node, but the existing-keys probe only inspected the first entry. Keys living on any other shard made the create-index page claim the database is empty and enter manual creation. Aggregate the check across all returned nodes. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The probe cleared its error flag at the start of every re-check, so after a failed check the create-index page briefly saw error=false with hasKeys=false and entered manual mode, defeating the browse-mode fallback. Keep the previous result until the new one lands. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…te-index page Only the create-index page consumes the probe since the entry-point guards were removed, yet it still ran from VectorSearchProvider on every Vector Search route change — two broad key scans per navigation. Move the hook into the page and drop the now-unused context fields. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…er mount The probe is page-scoped now, so the silent re-check machinery guarded transitions that always coincide with an unmount. Every check reports loading again (a re-check implies a new database context) and the dead pathname trigger is dropped, so no consumer can observe a stale result. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A scan that stops at the backend threshold without finding Hash/JSON keys does not prove the database is empty — large mixed keyspaces could be forced into manual creation while selectable keys exist beyond the scan window. Enter manual mode only when the scan completed (cursor 0 on every node) and found nothing. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… flow Sample-data and preselected-key create URLs never use the probe result but still fired the two Hash/JSON key scans. Gate the hook behind an enabled flag driven by the browse flow. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A dependency-triggered re-probe could either flash the full-page loader over an in-progress definition or briefly show a stale result, yet its only triggers (database or encoding change) always remount the page. Start the check once per mount and keep the abort tied to unmount, so neither failure mode is possible. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
6315097 to
04a5dcd
Compare
The once-per-mount guard also suppressed the corrective scan when the connected instance settles after a database switch, so the layout could reflect the previous database's keyspace. Key the guard by database and encoding: exactly one scan per combination, with a stale in-flight scan aborted when they change. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eeba2f78a3
ℹ️ 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".
With the instance guard moved to the effect, a missing connected instance id skipped the scan without ever clearing the initial loading state, leaving the create-index page on the full-page loader. Report an inconclusive check instead, which falls back to browse mode; the probe still re-arms once the id settles. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The hook read the connected-instance selector, which can lag behind the route on a direct create-index navigation between databases — a fast probe against the previous database could drive the layout for the new one. Take the database id from the caller (the route param) instead. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rovider The page passed both showBrowser and isManualCreation, though one is a function of the other plus props the provider already receives. Derive it from mode, preselected key, and isManualCreation instead. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The ref-based scan guard and AbortController plumbing duplicated what effect dependencies already provide: one scan per (enabled, database, encoding), cancelled on change or unmount. Inline the fetch into the effect with a cancelled flag. Behavior is unchanged and covered by the existing tests. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb1478c018
ℹ️ 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".
…r the original Restore the original hook structure (AbortController, signal handling, connected-instance selector) and keep only the scan fixes on top of it: batched scan count, all cluster nodes checked, and an incomplete scan counting as having keys. Drops the error fallback, enabled gating and route-id parameter added during review iterations. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Move the shared existing-data + no-keys setup into a nested beforeEach and extract an addField helper for the repeated field-modal flow. No change in coverage. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ea9df719c
ℹ️ 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".
…robe Re-add two guards to the existing-keys probe: a failed or inconclusive scan now reports an error so the create-index page keeps the key browser instead of hiding it behind manual creation, and the probe is gated on the browse flow so sample-data and preselected-key URLs no longer fire the scans. References: #RI-8171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 96f8b9d. Configure here.

What
Allows the Vector Search create-index wizard to be used on databases with no Hash/JSON keys:
useHasExistingKeys), since the page layout now depends on it:SCAN_COUNT_DEFAULTinstead ofcount: 1, scanThreshold: 1, which gave up after a single scanned key — false "no keys" whenever a non-Hash/JSON key came first in scan order, and key-by-key round trips;data[0]was read, so keys living on any other shard made the wizard claim the database was empty;Notes for review: the prefix is optional in manual mode to match the browse flow (an empty prefix indexes all keys of the selected type), and manual creations report the same
data_source: existingDatatelemetry as the browse flow.Testing
Testing the cluster edge case (keys on a non-first shard)
The keys endpoint returns one scan result per cluster node; before this PR the probe read only the first entry, so keys on any other shard showed manual creation instead of the key browser.
redisDocker images ship without the search module —redis/redis-stack-serveris required.)127.0.0.1:7101to RedisInsight — it auto-discovers as an OSS Cluster.{N}hashtag controls which shard it lands on:DELthe key, reseed asuser:{2},user:{3},user:{4}) — every placement must show the browser. Before the fix, keys on non-first response nodes (discovery order, not slot order) produced manual creation instead.docker rm -f redis-cluster-search.Closes #RI-8171
🤖 Generated with Claude Code
Note
Medium Risk
Layout and FT.CREATE inputs now depend on a hardened keys scan (cluster/incomplete-scan edge cases); wrong probe results could show manual vs browse incorrectly, but failures intentionally fall back to browse mode.
Overview
Enables Vector Search index creation when a database has no Hash/JSON keys, instead of blocking entry with “no keys” tooltips and disabled actions.
Entry points: The welcome secondary action and list Use existing data are always available and relabeled to Create index; global
hasExistingKeysgating is removed fromVectorSearchProvider, welcome screen, and create menu.Create-index page: On browse (
?mode=existingDatawithout a preselected key),useHasExistingKeysruns once (with a loader). A confirmed empty scan switches to manual creation: hide the key browser, show manual empty-state copy, allow + Add field, index name/prefix editing, and a HASH/JSON key-type toggle; create is enabled with at least one field (no key selection). Probe errors or inconclusive scans (incomplete cursor) keep browse mode with the browser visible.useHasExistingKeys: Scans useSCAN_COUNT_DEFAULT, aggregate all cluster nodes, treat non-zero cursor as “has keys,” exposeerrorand anenabledflag; the hook is no longer used app-wide for disabling UI.i18n updates in
enandbg; unit/e2e tests cover manual mode and probe behavior.Reviewed by Cursor Bugbot for commit 96f8b9d. Bugbot is set up for automated code reviews on this repo. Configure here.