Skip to content

Conversation

@bsbodden
Copy link
Collaborator

Previously, HybridQuery hardcoded text_score to 1.0, making the hybrid formula effectively ignore text relevance. This was an incomplete port from the Python RedisVL implementation.

Changes:

  • Add aggregation.addScores() to enable the @__score field in FT.AGGREGATE
  • Use @__score (the actual BM25/text search score) instead of hardcoded 1.0
  • Update Javadoc to document Redis 7.4.0+ requirement for ADDSCORES
  • Update formula documentation to clarify the scoring mechanism

The hybrid scoring formula now correctly applies:
hybrid_score = (1 - alpha) * text_score + alpha * vector_similarity

Where text_score is the actual BM25 score from Redis, not a constant.

Requires: Redis 7.4.0+
Reference: Python redisvl/query/aggregate.py lines 168-173

Previously, HybridQuery hardcoded text_score to 1.0, making the hybrid
formula effectively ignore text relevance. This was an incomplete port
from the Python RedisVL implementation.

Changes:
- Add aggregation.addScores() to enable the @__score field in FT.AGGREGATE
- Use @__score (the actual BM25/text search score) instead of hardcoded 1.0
- Update Javadoc to document Redis 7.4.0+ requirement for ADDSCORES
- Update formula documentation to clarify the scoring mechanism

The hybrid scoring formula now correctly applies:
  hybrid_score = (1 - alpha) * text_score + alpha * vector_similarity

Where text_score is the actual BM25 score from Redis, not a constant.

Requires: Redis 7.4.0+
Reference: Python redisvl/query/aggregate.py lines 168-173
@bsbodden bsbodden self-assigned this Dec 13, 2025
@bsbodden bsbodden merged commit fb02e77 into main Dec 13, 2025
4 checks 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.

2 participants