DOC-6843 Add redis-rb (Ruby) Query Engine docs: queryjson [PARKED]#3641
Open
andy-stark-redis wants to merge 2 commits into
Open
DOC-6843 Add redis-rb (Ruby) Query Engine docs: queryjson [PARKED]#3641andy-stark-redis wants to merge 2 commits into
andy-stark-redis wants to merge 2 commits into
Conversation
… command mappings Preemptive, parked docs for redis-rb's Query Engine (RediSearch), which merged upstream in redis-rb #1356 but is not yet in a released gem — the latest is v5.4.1 from July 2025, which predates it. Adds the "Index and query documents" page for Ruby, a run-verified example set, and redis_rb signatures across the FT.* command-api-mapping files. Builds on the parked JSON docs (DOC-6842), since the index-documents page indexes JSON documents. Three non-obvious things for whoever edits these next. First, the page embeds the ruby_home_json set, not the query_ft/query_em/etc sets — those back the search-and-query tutorial pages, a different area, so adding Ruby there is a separate job. Second, redis-rb's Search::Index strips the index key prefix from returned document ids, so the client reports the logical id ("3") rather than the full key ("user:3") as redis-py does; the page and example call this out so the output comments aren't mistaken for errors. Third, the example's outputs and REMOVE-block asserts are not guesses — the file was run against the local redis-rb fork (master, PR #1356) on Redis 8.8 and passed all steps, so the only real risk is the upstream API changing before the gem ships. For the mappings, FT.CREATE/SEARCH/AGGREGATE/DROPINDEX carry both the high-level (create_index/search/aggregate/drop) and the low-level ft_* signature, because the fork ships that two-layer API deliberately; the rest carry just the ft_* method. FT.EXPLAINCLI and FT._LIST are omitted — redis-rb has no method for them. Learned: redis-rb Index strips the key prefix from doc ids; queryjson embeds the *_home_json set not the query_* tutorial sets; outputs run-verified against the fork, not guessed Constraint: regenerate data/command-api-mapping.json with build/merge-command-api-mapping.sh after editing per-command files — never hand-edit the merged file, and run the script with the sandbox off (its mktemp hits the blocked system temp dir) Directive: parked — do not merge until redis-rb ships the Query Engine in a released gem; vecsearch.md and Ruby snippets in the search-and-query tutorial pages are deferred follow-ups Recheck: next redis-rb gem release (Query Engine is master-only via PR #1356) Gaps: verified against fork master on Redis 8.8, not a released gem — re-run the example and add a "requires redis-rb vX.Y+" note at pickup Ticket: DOC-6843 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Query Engine support this page documents isn't in a released gem yet, so warn readers the API is subject to change until pickup. Ticket: DOC-6843 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preemptive docs for redis-rb's Query Engine (RediSearch /
FT.*): a new "Index and query documents" page for Ruby (content/develop/clients/ruby/queryjson.md), a run-verifiedruby_home_jsonexample set, andredis_rbsignatures across theFT.*command-api-mapping files. Builds on the parked JSON docs (DOC-6842 / #3629), since the index-documents page indexes JSON documents.⛔ Do not merge yet
The Query Engine landed upstream in redis-rb#1356 (merged) but is not yet in a released gem — the latest is
v5.4.1(July 2025), which predates it. Merging now would document APIs (Redis::Commands::Search::*,create_index/ft_*) thatgem install rediscannot provide. The page carries a previewbannerTextand this PR is labelledparked+do not merge yet.Park manifest
Ticket: DOC-6843
Parked at: 2026-07-15
Trigger to pick up: redis-rb#1356 shipped in a released
redisgem (a version later than v5.4.1 whoselib/redis/commands/modules/searchis present)Labels: parked, do not merge yet
Pinned sources (state observed at park time)
state: closed,merged: true, head SHA659d885199d09b997172d753a2f67c39ee23769e, basemaster, milestone: none, updated2026-07-14(squash-merged to master as71706ec)gh api repos/redis/redis-rb/pulls/1356 --jq '{state, merged, head_sha: .head.sha, base: .base.ref, milestone: .milestone.title, updated_at}'v5.4.1(July 2025) — predates the Query Engine; no release yet contains #1356Observed shape the page assumes — confidence: MEDIUM
The example and
FT.*mappings were run-verified against the local redis-rb fork (master, PR #1356 merged) on Redis 8.8.0 — the example passed all steps and every REMOVE-block assert. Confidence is MEDIUM rather than HIGH only because it was verified against forkmaster, not a released gem, so the surface could still shift before release. Key assumptions:Redis::Commands::SearchwithSchema.build { text_field '$.p', as: 'x'; tag_field; numeric_field },IndexDefinition.new(prefix:, index_type: …::IndexType::JSON|HASH),r.create_index(name, schema, definition:)→ a statefulSearch::Index.index.search('raw query', return_fields:)and theSearch::Querybuilder (.return_field(f, as_field:)); aggregation viaSearch::AggregateRequest#group_by+Search::Reducers.count.as('count').Search::Indexstrips the index key prefix from returned doc IDs —doc.idis the logical id (3), not the full key (user:3) as redis-py returns. The page/example call this out.FT.CREATE/SEARCH/AGGREGATE/DROPINDEXmappings carry both the high-level (create_index/search/aggregate/drop) and low-level (ft_*) signatures; the rest carryft_*only.Re-check checklist
local_examples/client-specific/ruby/home_json.rbagainst the released gem on Redis 8.x; confirm all steps + asserts still pass and the API shape above is unchanged.queryjson.mdonce the release version is known (harvested from theGaps:trailer).bannerTextfromqueryjson.mdonce released.redis_rbFT.*signatures/return types still match the released gem; if changed, edit the per-command files underdata/command-api-mapping/and regeneratedata/command-api-mapping.jsonviabuild/merge-command-api-mapping.sh(never hand-edit the merged file).examples.jsonregenerates the Ruby tab fromruby_home_jsonin a full CI build (couldn't runbuild/local_examples.pylocally —pytoml/pip constraints).query_*search-and-query tutorial examples;vecsearch.mdvector page.On pickup, then
When the trigger fires, run
/pickup 3629-style for this PR (/pickup <this PR#>): it diffs each pinned source against the snapshot above, walks this checklist, then takes the PR through the normal/reflect→/finalizepipeline to merge. Thedo not merge yetguard holds until/finalizecompletes.🤖 Generated with Claude Code
Note
Low Risk
Documentation and generated API metadata only; no runtime or security-sensitive code, with an explicit pre-release banner.
Overview
Adds pre-release Ruby client documentation for the redis-rb Query Engine (
Redis::Commands::Search), including a new Index and query documents page that walks through JSON indexing, search, field projection, aggregation, and the hash-document variant via embeddedruby_home_jsonexamples.Introduces a run-verified
local_examples/client-specific/ruby/home_json.rbexample set (with step markers and asserts) backing those shortcodes.Extends command reference data by adding
redis_rbclient signatures for a broad set ofFT.*commands (create/search/aggregate, aliases, cursors, dictionaries, suggestions, hybrid search, etc.) in per-command mapping files and the mergeddata/command-api-mapping.json. The new doc page uses a banner noting the APIs are not yet in a released gem.Reviewed by Cursor Bugbot for commit 3ea0f4d. Bugbot is set up for automated code reviews on this repo. Configure here.