Skip to content

DOC-6843 Add redis-rb (Ruby) Query Engine docs: queryjson [PARKED]#3641

Open
andy-stark-redis wants to merge 2 commits into
mainfrom
DOC-6843-redis-rb-query-engine-docs
Open

DOC-6843 Add redis-rb (Ruby) Query Engine docs: queryjson [PARKED]#3641
andy-stark-redis wants to merge 2 commits into
mainfrom
DOC-6843-redis-rb-query-engine-docs

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

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-verified ruby_home_json example set, and redis_rb signatures across the FT.* 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_*) that gem install redis cannot provide. The page carries a preview bannerText and this PR is labelled parked + 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 redis gem (a version later than v5.4.1 whose lib/redis/commands/modules/search is present)
Labels: parked, do not merge yet

Pinned sources (state observed at park time)

Source State at park Re-fetch
redis-rb#1356 — Query Engine support state: closed, merged: true, head SHA 659d885199d09b997172d753a2f67c39ee23769e, base master, milestone: none, updated 2026-07-14 (squash-merged to master as 71706ec) gh api repos/redis/redis-rb/pulls/1356 --jq '{state, merged, head_sha: .head.sha, base: .base.ref, milestone: .milestone.title, updated_at}'
redis-rb released gem latest released v5.4.1 (July 2025) — predates the Query Engine; no release yet contains #1356 `gh api repos/redis/redis-rb/tags --jq '.[0:5]

Observed 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 fork master, not a released gem, so the surface could still shift before release. Key assumptions:

  • Namespace Redis::Commands::Search with Schema.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 stateful Search::Index.
  • index.search('raw query', return_fields:) and the Search::Query builder (.return_field(f, as_field:)); aggregation via Search::AggregateRequest#group_by + Search::Reducers.count.as('count').
  • Search::Index strips the index key prefix from returned doc IDsdoc.id is the logical id (3), not the full key (user:3) as redis-py returns. The page/example call this out.
  • FT.CREATE/SEARCH/AGGREGATE/DROPINDEX mappings carry both the high-level (create_index/search/aggregate/drop) and low-level (ft_*) signatures; the rest carry ft_* only.

Re-check checklist

  • (highest risk) Re-run local_examples/client-specific/ruby/home_json.rb against the released gem on Redis 8.x; confirm all steps + asserts still pass and the API shape above is unchanged.
  • Add a "requires redis-rb vX.Y+" note to queryjson.md once the release version is known (harvested from the Gaps: trailer).
  • Remove the preview bannerText from queryjson.md once released.
  • Confirm the redis_rb FT.* signatures/return types still match the released gem; if changed, edit the per-command files under data/command-api-mapping/ and regenerate data/command-api-mapping.json via build/merge-command-api-mapping.sh (never hand-edit the merged file).
  • Confirm examples.json regenerates the Ruby tab from ruby_home_json in a full CI build (couldn't run build/local_examples.py locally — pytoml/pip constraints).
  • Deferred (separate tickets, not this PR): Ruby query_* search-and-query tutorial examples; vecsearch.md vector 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/finalize pipeline to merge. The do not merge yet guard holds until /finalize completes.

🤖 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 embedded ruby_home_json examples.

Introduces a run-verified local_examples/client-specific/ruby/home_json.rb example set (with step markers and asserts) backing those shortcodes.

Extends command reference data by adding redis_rb client signatures for a broad set of FT.* commands (create/search/aggregate, aliases, cursors, dictionaries, suggestions, hybrid search, etc.) in per-command mapping files and the merged data/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.

andy-stark-redis and others added 2 commits July 14, 2026 15:39
… 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>
@andy-stark-redis andy-stark-redis added do not merge yet parked PR speculatively added based on pre-release info. Check validity when release goes ahead. labels Jul 15, 2026
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

DOC-6843

@github-actions

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge yet parked PR speculatively added based on pre-release info. Check validity when release goes ahead.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant