Skip to content

DX-2352: redis search#70

Merged
CahidArda merged 12 commits intomainfrom
DX-2352-redis-search
Mar 18, 2026
Merged

DX-2352: redis search#70
CahidArda merged 12 commits intomainfrom
DX-2352-redis-search

Conversation

@CahidArda
Copy link
Copy Markdown
Collaborator

No description provided.

CahidArda and others added 11 commits January 21, 2026 12:00
…rors

Add aggregation framework (SEARCH.AGGREGATE) with response parsing for
metric, stats, bucket, and nested sub-aggregations. Add alias commands
(SEARCH.ALIASADD, SEARCH.ALIASDEL, SEARCH.LISTALIASES) at both top-level
and index-level. Add KEYWORD and FACET field types with $in operator
support. Update formatters for new commands and handle not-found cases
in query/describe. Fix all pre-existing mypy errors in scorefunc tests
and utils by using proper enum types and cast narrowing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear
Copy link
Copy Markdown

linear Bot commented Feb 19, 2026

@alitariksahin
Copy link
Copy Markdown
Contributor

alitariksahin commented Mar 16, 2026

asked for an ai review, comparing with redis-js implementation, can you check

redis-py Search: Missing Features & Bugs

Missing Commands

  • SEARCH.AGGREGATEindex.aggregate() method not implemented
  • SEARCH.ALIASADD — alias add not implemented
  • SEARCH.ALIASDEL — alias delete not implemented
  • SEARCH.LISTALIASES — list aliases not implemented

Missing Field Types

  • KEYWORD field type missing from FieldType enum in search.py
  • FACET field type missing from FieldType enum in search.py

Bugs

  • HIGHLIGHT command serialization is broken — highlight["fields"] is passed as a single list element instead of being spread with a count prefix (FIELDS <n> <f1> <f2> ...)
  • HIGHLIGHT tags check uses if highlight["tags"]: which raises KeyError when tags is not provided — should be if "tags" in highlight:
  • create_index return type annotation is ResponseT but actually returns SearchIndexCommands — breaks type inference
  • query filter parameter is required but should be optional to allow match-all queries

Missing Types / Documentation

  • No typed filter DSL — $and, $or, $must, $should, $mustNot, $in, $boost operators are untyped and undocumented (they work at runtime since filter is raw JSON, but there's no type support)
  • No aggregate types — no AggregateOptions, AggregateResult, or aggregation operator types
  • No alias types — no types for alias add/list/delete responses

- HIGHLIGHT FIELDS now sends count prefix + spread fields to match protocol
- HIGHLIGHT tags check uses safe key lookup to avoid KeyError
- query filter parameter is now optional, defaults to match-all ({})
- index() and alias return types use ResponseT for consistency

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@CahidArda
Copy link
Copy Markdown
Collaborator Author

CahidArda commented Mar 18, 2026

I think you were on an older branch, not all of the things listed were missing.

Made a few small fixes, ready for review

for the filter being not typed: Python isn't as powerful as TS, so we decided to not type filters/aggregations in PY

@CahidArda CahidArda merged commit c8d7c49 into main Mar 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants