Repository navigation
fix(ruby): align FT search builder options with other GLIDE clients - #398
Merged
Merged
Conversation
Aryex
pushed a commit
that referenced
this pull request
Oct 30, 2026
Signed-off-by: Minh [C] Quang Le <lehminh@amazon.com>
Aryex
force-pushed
the
agent/388/ft-search-builders
branch
from
October 30, 2026 14:52
b6576dc to
9342709
Compare
Aryex
added a commit
that referenced
this pull request
Oct 30, 2026
Signed-off-by: Alex Le <alex.le@improving.com>
Aryex
force-pushed
the
agent/388/ft-search-builders
branch
4 times, most recently
from
October 30, 2026 15:41
642dc85 to
d34728f
Compare
- CreateOptions: `stopwords: []` sends `STOPWORDS 0` instead of being dropped, matching Python, Java and Node (#386). - AggregateOptions: `clauses` defaults to nil, and nil means no clauses instead of raising NoMethodError (#387). - SearchOptions: `sort_order` without `sort_by` raises ArgumentError instead of being silently ignored, matching all other clients (#388). Signed-off-by: Alex Le <alex.le@improving.com>
Signed-off-by: Alex Le <alex.le@improving.com>
Aryex
force-pushed
the
agent/388/ft-search-builders
branch
from
October 30, 2026 15:45
80a002c to
3e1fc1f
Compare
Signed-off-by: Alex Le <35547559+Aryex@users.noreply.github.com>
Aryex
marked this pull request as ready for review
October 30, 2026 15:57
yipin-chen
approved these changes
Oct 30, 2026
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.
Summary
Fixes FT Search builder options that silently dropped what the caller asked for, or crashed on a "not given" value. Behaviour now matches the other GLIDE clients (Python, Java, Node, Go). All changes are in Ruby-side request construction, before the command reaches GLIDE Core.
Also removes the "redis-rb conventions" rule from
AGENTS.md: GLIDE clients are the reference for command behaviour.Issue link
clauses: nilcase)Changes
CreateOptionsstopwords:(Search Module: Preserve explicit empty FT.CREATE stopword lists #386):[]used to be dropped, so the server used its default stopwords. It now sendsSTOPWORDS 0, which turns stopword removal off.nilstill sends nothing.AggregateOptionsclauses:(Search Module: Leaking NoMethodError #387): the default is nownil, andnilmeans no clauses. Before,clauses: nilraisedNoMethodError.SearchOptionssort_order:(Search Module: Reject sort_order when sort_by is omitted #388): the default is nownil.sort_orderwithoutsort_byraisesArgumentError, "sort_order requires sort_by". Before, it was silently ignored.sort_bywith no order now sends onlySORTBY <field>and lets the server apply its default (ascending). Before, Ruby always addedASC. Results are unchanged.AGENTS.md: removed the "Prefer matching redis-rb method signatures and return types" rule.stopwords: []STOPWORDS 0STOPWORDS 0STOPWORDS 0STOPWORDS 0clauses: nilSORTBY fSORTBY fSORTBY fSORTBY fSORTBY fLimitations
sort_order:withoutsort_by:used to be silently ignored and now raises.return_fields: "title"from Search Module: Leaking NoMethodError #387, aren't checked at runtime. Ruby relies on the documented YARD types, and none of the other clients validates these at runtime either.Testing
test/unit/commands/search_builder_test.rb:test_create_options_stopwords_empty,test_create_options_rejects_empty_stopwords_with_no_stopwords,test_ft_create_builder_with_empty_stopwordstest/unit/commands/search_query_test.rb:test_sort_order_asc,test_sort_order_nil,test_sort_order_requires_sort_by,test_ft_search_sort_order_requires_sort_by(checks that nothing is sent),test_return_fields_empty,test_params_emptytest/unit/commands/search_aggregate_test.rb:test_aggregate_options_nil_clausesSORTBY <field>withoutASCwhen no order is given.test_sort_by_default_asc_and_descwas renamed totest_sort_by_without_order_and_desc.test_create_options_empty_stopwords_emits_nothing, which asserted the Search Module: Preserve explicit empty FT.CREATE stopword lists #386 bug.bundle exec rake test:unit(524 tests, 0 failures) andbundle exec rubocop(no offenses). Integration tests run in CI.Checklist
Before submitting the PR make sure the following are checked:
git commit -s) per the DCO.bundle exec rubocop) and pass.