Skip to content

MOD-11172: Refactor Hybrid Parsing#6857

Merged
kei-nan merged 28 commits intomasterfrom
rrf_jk_refactor_hybrid_parsing
Sep 26, 2025
Merged

MOD-11172: Refactor Hybrid Parsing#6857
kei-nan merged 28 commits intomasterfrom
rrf_jk_refactor_hybrid_parsing

Conversation

@kei-nan
Copy link
Collaborator

@kei-nan kei-nan commented Sep 18, 2025

This PR aims to refactor the hybrid parsing by using the newly added ArgsParser.
It also aims to separate the hybrid parsing flow from the aggregation or search flows.

A clear and concise description of what the PR is solving, including:

  1. Current: Parsing of HYBRID is accepting keywords it shouldn't from the Aggregate and Search worlds.
  2. Change: Separate the hybrid parsing and use ArgsParser to make our lives a bit easier.
  3. Outcome: Better and more maintainable parsing code which does not depend on the aggregation/search keywords.

Main objects this PR modified

  1. Hybrid Parsing

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

@kei-nan kei-nan self-assigned this Sep 18, 2025
@kei-nan kei-nan force-pushed the rrf_jk_refactor_hybrid_parsing branch from 0e62e18 to 767f7fa Compare September 18, 2025 18:00
cursor[bot]

This comment was marked as outdated.

ARG_OPT_END);

// WITHSCORES flag - sets QEXEC_F_SEND_SCORES
ArgParser_AddBitflagV(parser, "WITHSCORES", "Include scores in results",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check this, it seems WITHSCORES is only supported by FT.SEARCH

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, we need the scores to be sent in hybrid.
So we want to support this keyword.
Originally was meant to be added in the next PR:
#6858
But the change wound up here.
If you prefer I can move it to the next PR.

cursor[bot]

This comment was marked as outdated.

@kei-nan kei-nan force-pushed the rrf_jk_refactor_hybrid_parsing branch from 717debb to 884102e Compare September 21, 2025 14:02
cursor[bot]

This comment was marked as outdated.

@kei-nan kei-nan force-pushed the rrf_jk_refactor_hybrid_parsing branch from 884102e to 75eb31a Compare September 21, 2025 14:07
cursor[bot]

This comment was marked as outdated.

@kei-nan kei-nan force-pushed the rrf_jk_refactor_hybrid_parsing branch from 609d6e1 to a782eb6 Compare September 21, 2025 16:15
cursor[bot]

This comment was marked as outdated.

@kei-nan kei-nan force-pushed the rrf_jk_refactor_hybrid_parsing branch from a782eb6 to 8964ee9 Compare September 21, 2025 16:35
@kei-nan kei-nan requested a review from nafraf September 21, 2025 18:31
cursor[bot]

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Sep 21, 2025

Codecov Report

❌ Patch coverage is 85.33654% with 61 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.25%. Comparing base (13846c1) to head (94be2ba).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
src/hybrid/parse/hybrid_callbacks.c 81.62% 43 Missing ⚠️
src/hybrid/parse/hybrid_combine.c 86.86% 13 Missing ⚠️
src/hybrid/parse/hybrid_optional_args.c 92.45% 4 Missing ⚠️
src/util/arg_parser.c 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6857      +/-   ##
==========================================
+ Coverage   86.24%   86.25%   +0.01%     
==========================================
  Files         304      307       +3     
  Lines       48983    49289     +306     
  Branches     9543     9543              
==========================================
+ Hits        42243    42516     +273     
- Misses       6590     6623      +33     
  Partials      150      150              
Flag Coverage Δ
flow 84.25% <70.43%> (+0.47%) ⬆️
unit 51.74% <77.40%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

cursor[bot]

This comment was marked as outdated.

@kei-nan kei-nan requested a review from JoanFM September 23, 2025 13:14
Copy link
Collaborator

@JoanFM JoanFM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just small comments, feel free to ignore @kei-nan

@kei-nan kei-nan force-pushed the rrf_jk_refactor_hybrid_parsing branch from e7078ff to 84659b5 Compare September 25, 2025 06:48
JoanFM
JoanFM previously approved these changes Sep 25, 2025
Base automatically changed from rrf_jk_arg_parser to master September 25, 2025 10:49
@kei-nan kei-nan dismissed JoanFM’s stale review September 25, 2025 10:49

The base branch was changed.

@kei-nan kei-nan requested a review from JoanFM September 25, 2025 11:19
@kei-nan kei-nan added this pull request to the merge queue Sep 25, 2025
@kei-nan kei-nan removed this pull request from the merge queue due to a manual request Sep 25, 2025
@kei-nan kei-nan added this pull request to the merge queue Sep 25, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 25, 2025
@kei-nan kei-nan added this pull request to the merge queue Sep 26, 2025
Merged via the queue into master with commit a990a64 Sep 26, 2025
16 checks passed
@kei-nan kei-nan deleted the rrf_jk_refactor_hybrid_parsing branch September 26, 2025 11:07
YaacovHazan pushed a commit to redis/redis that referenced this pull request Oct 27, 2025
(RediSearch/RediSearch#7076,
RediSearch/RediSearch#6857) - Introducing
`FT.HYBRID`, a new command that enables hybrid queries combining both
text and vector search, with support for **RRF** and **LINEAR** result
combination. This update enhances performance and reliability through a
more efficient networking layer, smoother query execution, and improved
overall stability.
(RediSearch/RediSearch#7065) - Add
`search-default-scorer` configuration to set the default text scorer
across queries (by default it is BM25).
RediSearch/RediSearch#7022 - Handle Atomic Slot
Migration events upon moving slots from one node to another in a cluster
mode.
(RediSearch/RediSearch#6769,
RediSearch/RediSearch#6828,
RediSearch/RediSearch#6877,
RediSearch/RediSearch#6921) - Introduce query
time memory guardrails by adding a new `search-on-oom` configuration
which defines the query engine behavior when OOM (Out Of Memory) is
reached. OOM checks are applied to `FT.SEARCH`, `FT.AGGREGATE`, and
`FT.HYBRID` commands. The behavior on OOM can be configured to one of
three modes: `IGNORE`, `FAIL`, or `RETURN`.
`IGNORE` - The default behavior, run queries anyway (not recommended for
heavy queries returning a large result set).
`FAIL` - Fail query execution immediately if any of the nodes are in OOM
state when query execution starts.
`RETURN` - A best effort appraoch to return partial results when OOM is
detected in only some of the nodes in a cluster mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants