Skip to content

fix: fix some issues found in the search sdk review#1402

Merged
alitariksahin merged 4 commits into
redis-searchfrom
search-refactor
Dec 29, 2025
Merged

fix: fix some issues found in the search sdk review#1402
alitariksahin merged 4 commits into
redis-searchfrom
search-refactor

Conversation

@mdumandag

Copy link
Copy Markdown
Contributor
  • added support for json type
  • fixed tests, which was not checking the result properly
  • disallow singular mustnot on the root queries
  • use correct command name for wait indexing
  • fix inefficiency in response parsing
  • add missing operator support for date fields
  • handle describe of non-existing indexes

- added support for json type
- fixed tests, which was not checking the result properly
- disallow singular mustnot on the root queries
- use correct command name for wait indexing
- fix inefficiency in response parsing
- add missing operator support for date fields
- handle describe of non-existing indexes
@alitariksahin alitariksahin merged commit 26e8607 into redis-search Dec 29, 2025
13 of 14 checks passed
@alitariksahin alitariksahin deleted the search-refactor branch December 29, 2025 08:29
CahidArda added a commit that referenced this pull request Mar 11, 2026
* feat: initialize redis search sdk

* feat: add typesafe zod-like schema builder

* feat: add typesafe query

* feat: complete core functionalities of redis search sdk

* feat: redis-search v0

* fix: mv filter parameter inside query options

* feat: improve typing

* feat: update sdk to conform with the directives in draft7

* feat: convert dot notaion to object in query return type

* fix: remove unused test file

* fix: text -> string, bool -> boolean

* fix: tests

* fix: change count return type

* feat: edit schema of describe return type

* feat: enhance filter types

* feat: improve typing

* fix: type inference issues

* fix: type casting

* fix: fix some issues found in the search sdk review (#1402)

* fix: fix some issues found in the search sdk review

- added support for json type
- fixed tests, which was not checking the result properly
- disallow singular mustnot on the root queries
- use correct command name for wait indexing
- fix inefficiency in response parsing
- add missing operator support for date fields
- handle describe of non-existing indexes

* fix: support complex  operator

* fix: type error in redis.tests

* fix: make slop and prefix mutually exclusive

* fix: allow empty filter

following are allowed:
- index.query()
- index.query({})
- index.query({ filter: {} })

these all mean 'select *'

* fix: allow passing array of arguments as filters

if we don't allow arrays, we can't express simple queries like (a and b) or (c and d)

* fix: simplify createIndex type

make client another parameter, make type name start with capital letter

* fix: rm createIndex/index from exports and add InferFilterFromSchema

* fix: add $ before all ops and add index creation options

* fix: add from field to text builder

* fix: add from to all field types

* fix: rm generic from from

* fix: rm aliased fields from query response

* fix: rename some types and make initIndex params object

* fix: rm mustNot from root

* fix: update response of waitIndexing and drop

* fix: rm $ from fuzzy and phrase ops

* fix: make search tests more detailed

* fix: add test with highlight

* fix: add FROM tests

* fix: rename select and orderby fields

* fix: make result.data any if schema not provided

* fix: rm test.ts

* fix: issues in query result and select parameter relation

* fix: add QueryResult to exports

* fix: add redis-search-example

* fix: make PublicQueryResult default all fields

* fix: fix build errors

* fix: parse score as number

* fix: go over the example

* fix: rm unnecessary files

* fix: nested type field misinterpreted

field: s.object({ type: s.string() })) wasn't interpreted correctly

* fix: typesafety issue

* fix: allow boost in the leaf

* fix: add smart operator and date tests

* feat: add scoreFunc

* fix: update LLM.txt

* feat: add redis-search example (posthog)

* fix: add SearchIndex to exports

* fix: add aggregations

* feat: add alias commands

* feat: add keyword field

* fix: add keyword to create index test

* fix: handle non-existing index in describe and query

- describe() returns null when index doesn't exist
- query() returns empty array when index doesn't exist

* fix: update responses for missing index requesetw

* fix: update aggregate response parsing for new server format

Server no longer wraps aggregate responses in an outer array and returns
some float values as strings. Also removes LIMIT support from aggregate
as the server no longer accepts it, and adds sumOtherDocCount and
docCountErrorUpperBound fields to terms aggregation results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add facets

* fix: change keyword operators to number from string

* fix: define KeywordOperations with string values for KEYWORD fields

KEYWORD fields should use string values, not numbers. Added KeywordOperationMap
and KeywordOperations types with the same operators as number ($eq, $ne, $in,
$gt, $gte, $lt, $lte) but requiring string values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: fmt

* fix: allow mustNot in RootOrNode

* fix: rm ne operator

* feat: add support for prefix option for  operator (#1405)

Co-authored-by: Cahid Arda <cahidardaooz@hotmail.com>

* fix: to initIndex

* fix: add sleep

* fix: prevent excessively deep type instantiation for untyped SearchIndex

Add IsDefaultSchema short-circuits to QueryOptions, QueryFilter,
RootQueryFilter, AggregateOptions, Aggregation, AggregateResult, and
IndexDescription to avoid TS2589 when using SearchIndex without a schema.

Add search-typesafety.test.ts with 68 mocked tests covering typed/untyped
initialization, query, count, aggregate, describe, and compile-time checks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: update return types in addAlias and delAlias functions; improve type checks in deserializeQueryResponse; enhance search tests with index creation and data seeding

* chore: remove unused VSCode settings for redis-search example

---------

Co-authored-by: alitariksahin <alitariksah@gmail.com>
Co-authored-by: Metin Dumandag <29387993+mdumandag@users.noreply.github.com>
Co-authored-by: ytkimirti <yusuftaha9@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants