feat(search): add FT.ALIASLIST command#3351
Open
nkaradzhov wants to merge 3 commits into
Open
Conversation
Add the FT.ALIASLIST command to @redis/search. Given an index name, it returns all aliases currently associated with that index, making alias discovery a first-class read-only API instead of relying on FT.INFO. The command is read-only and keyless. The reply is an unordered collection of alias strings: RESP2 array, RESP3 set. An existing index with no aliases yields an empty collection. The client adds no validation and propagates server errors (SEARCH_INDEX_NOT_FOUND, NOPERM) unchanged. Available from RediSearch 8.10.0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a rejection test asserting the SEARCH_INDEX_NOT_FOUND error prefix is propagated unchanged for a missing index, per the command's error contract. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Gate the FT.ALIASLIST integration tests with minimumDockerVersion [8, 10] so pre-8.10 CI matrix tags skip instead of failing with 'unknown command'. Pipeline test setup via Promise.all to match the sibling alias-command specs, and drop the non-conventional 'Read-only'/version prose from the registry JSDoc. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
This pull request adds the
FT.ALIASLISTcommand to@redis/search. Given an index name, it returns all aliases currently associated with that index — making alias discovery a first-class, read-only Query Engine API instead of relying on theFT.INFOworkaround. Available from RediSearch 8.10.0.The command sends the fixed wire shape
FT.ALIASLIST indexwith no optional arguments. It is read-only and keyless (theindexargument is a Query Engine identifier, not a Redis key), so it runs on replicas and executes on an arbitrary shard in cluster mode with no fanout. The reply is an unordered collection of alias name strings: RESP2 returns an array of bulk strings, RESP3 returns a set — both surfaced via the client's normal RESP handling. An existing index with no aliases yields an empty collection rather than an error.Behavior notes callers should be aware of: the server resolves the argument with no alias lookup, so passing an alias name (or a missing index) fails with
SEARCH_INDEX_NOT_FOUND Index not found: <name>; permission failures surface asNOPERM. The client adds no validation and propagates server errors unchanged. Result ordering is not part of the contract and must not be relied upon.🤖 Generated with Claude Code
Note
Low Risk
Additive read-only search client command with no auth or data-path changes; behavior is delegated to RediSearch 8.10+.
Overview
Adds
FT.ALIASLISTto@redis/searchso callers can list aliases for an index viaclient.ft.aliasList/ALIASLIST, instead of inferring them fromFT.INFO.The new command module emits
FT.ALIASLIST index, is marked read-only and not keyed, and types the reply as a RESP2 array or RESP3 set of alias strings. Integration tests cover argument encoding, empty vs populated alias lists (order-agnostic), andSEARCH_INDEX_NOT_FOUNDfor a missing index, gated on Redis 8.10+.Reviewed by Cursor Bugbot for commit b1dec94. Bugbot is set up for automated code reviews on this repo. Configure here.