Skip to content

Conversation

@bsbodden
Copy link

Implement modular Search architecture with complete feature parity to redis-py:

Core Components:

  • Schema and field definitions (TextField, NumericField, TagField, GeoField, VectorField, GeoShapeField)
  • Query builder with fluent API and advanced query syntax
  • Index management and operations (create, drop, alter, info)
  • Aggregation framework with reducers and grouping
  • Hybrid search combining text and vector queries
  • Result parsing and formatting

Search Features:

  • Full-text search with stemming, phonetic matching, and stop words
  • Vector similarity search supporting FLAT, HNSW, and SVS-VAMANA algorithms
  • Geospatial search with radius and polygon queries
  • Numeric and tag filtering
  • Aggregations with grouping, sorting, applying, and reducing
  • Hybrid search with score combination (RRF, linear)
  • Auto-complete/suggestions with fuzzy matching
  • Spell checking and synonym management
  • Query profiling and explain

Field Types:

  • TextField: full-text search with weights, phonetic matching, withsuffixtrie
  • NumericField: range queries with sortable option
  • TagField: exact-match filtering with case sensitivity and separators
  • GeoField: geospatial queries with radius search
  • VectorField: vector similarity with multiple algorithms and distance metrics
  • GeoShapeField: polygon-based geospatial queries

Advanced Features:

  • IndexDefinition for fine-grained index control
  • Query parameters for dynamic queries
  • Multiple dialect support (1, 2, 3, 4)
  • Cursor-based pagination for large result sets
  • Score explanations and custom scorers
  • Highlighting and summarization

Bug Fixes:

  • Fix PARAMS handling to preserve binary vector data (don't call .to_s on values)
  • Add DIALECT 2 requirement for KNN queries in Redis 8
  • Add convenience API for SORTBY (:sort_by + :asc parameters)
  • Fix field option ordering for proper Redis command syntax

Testing:

  • Add comprehensive test suite with 44 tests across 8 test files
  • Test coverage for all search features and edge cases
  • Hybrid search tests with vector + text queries
  • Aggregation tests with complex pipelines
  • Vector similarity tests with multiple algorithms

Documentation:

  • Add 6 example files demonstrating all features:
    • search_quickstart.rb: basic search operations
    • search_ft_queries.rb: advanced query syntax
    • search_aggregations.rb: aggregation pipelines
    • search_geo.rb: geospatial queries
    • search_range.rb: numeric range queries
    • search_vector_similarity.rb: vector search
    • search_with_hashes.rb: search with Redis hashes

Results: 44 tests, 215 assertions, 0 failures, 0 errors, 0 skips

@bsbodden bsbodden self-assigned this Dec 23, 2025
@bsbodden bsbodden requested review from byroot and uglide December 23, 2025 18:55
Implement modular Search architecture with complete feature parity to redis-py:

Core Components:
- Schema and field definitions (TextField, NumericField, TagField, GeoField, VectorField, GeoShapeField)
- Query builder with fluent API and advanced query syntax
- Index management and operations (create, drop, alter, info)
- Aggregation framework with reducers and grouping
- Hybrid search combining text and vector queries
- Result parsing and formatting

Search Features:
- Full-text search with stemming, phonetic matching, and stop words
- Vector similarity search supporting FLAT, HNSW, and SVS-VAMANA algorithms
- Geospatial search with radius and polygon queries
- Numeric and tag filtering
- Aggregations with grouping, sorting, applying, and reducing
- Hybrid search with score combination (RRF, linear)
- Auto-complete/suggestions with fuzzy matching
- Spell checking and synonym management
- Query profiling and explain

Field Types:
- TextField: full-text search with weights, phonetic matching, withsuffixtrie
- NumericField: range queries with sortable option
- TagField: exact-match filtering with case sensitivity and separators
- GeoField: geospatial queries with radius search
- VectorField: vector similarity with multiple algorithms and distance metrics
- GeoShapeField: polygon-based geospatial queries

Advanced Features:
- IndexDefinition for fine-grained index control
- Query parameters for dynamic queries
- Multiple dialect support (1, 2, 3, 4)
- Cursor-based pagination for large result sets
- Score explanations and custom scorers
- Highlighting and summarization

Testing:
- Add comprehensive test suite with 44 tests across 8 test files
- Test coverage for all search features and edge cases
- Hybrid search tests with vector + text queries
- Aggregation tests with complex pipelines
- Vector similarity tests with multiple algorithms

Documentation:
- Add 6 example files demonstrating all features:
  - search_quickstart.rb: basic search operations
  - search_ft_queries.rb: advanced query syntax
  - search_aggregations.rb: aggregation pipelines
  - search_geo.rb: geospatial queries
  - search_range.rb: numeric range queries
  - search_vector_similarity.rb: vector search
  - search_with_hashes.rb: search with Redis hashes
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