Skip to content

Commit 3feccd1

Browse files
docs(query): note that both hybrid searches run at alpha 0 and 1
An alpha of 0 or 1 only zeroes one side's score. Both searches still run, so point to VectorQuery and TextQuery for single-sided searches.
1 parent f91c0a4 commit 3feccd1

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎docs/user_guide/11_advanced_queries.ipynb‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,9 +1140,11 @@
11401140
"Where `alpha` controls the balance between text and vector search (default: 0.3 for `HybridQuery` and 0.7 for `AggregateHybridQuery`). Note that `AggregateHybridQuery` reverses the definition of `alpha` to be the weight of the vector score.\n",
11411141
"\n",
11421142
"The `alpha` parameter controls the weight between text and vector search:\n",
1143-
"- `alpha=1.0`: Pure text search (or pure vector search for `AggregateHybridQuery`)\n",
1144-
"- `alpha=0.0`: Pure vector search (or pure text search for `AggregateHybridQuery`)\n",
1145-
"- `alpha=0.3` (default - `HybridQuery`): 30% text, 70% vector"
1143+
"- `alpha=1.0`: Text score only (or vector score only for `AggregateHybridQuery`)\n",
1144+
"- `alpha=0.0`: Vector score only (or text score only for `AggregateHybridQuery`)\n",
1145+
"- `alpha=0.3` (default - `HybridQuery`): 30% text, 70% vector\n",
1146+
"\n",
1147+
"Both searches still run at `alpha=0.0` and `alpha=1.0`, so use `VectorQuery` or `TextQuery` when only one is needed."
11461148
]
11471149
},
11481150
{

‎redisvl/query/hybrid.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ def __init__(
9898
fusion scope.
9999
rrf_constant: The constant to use for the reciprocal rank fusion (RRF) combination method. Controls decay
100100
of rank influence.
101-
linear_alpha: The weight of the text query for the linear combination method (LINEAR).
101+
linear_alpha: The weight of the text query for the linear combination method (LINEAR). Both the text and
102+
vector searches still run at 0 and 1, so use `VectorQuery` or `TextQuery` when only one is needed.
102103
yield_combined_score_as: The name of the field to yield the combined score as.
103104
dtype: The data type of the vector. Defaults to "float32".
104105
num_results: The number of results to return.

0 commit comments

Comments
 (0)