Commit a5f9543
authored
feat: enable MMR diversity for hybrid search (#39)
* feat: enable MMR diversity for hybrid search
MMR (Maximal Marginal Relevance) was artificially blocked for hybrid
search in QQL, even though the Qdrant SDK supports it: Prefetch.query
accepts NearestQuery, which carries an MMR field.
- Remove the hybrid guard from _validate_search_mmr_usage
- Wire _build_dense_query() into the dense prefetch of both flat and
GROUP BY hybrid paths, so MMR params produce a NearestQuery(mmr=...)
instead of a raw vector
- Keep the sparse-only and recommend guards (MMR is a dense-space
concept and RecommendInput has no MMR field in the Qdrant API)
- Replace test_hybrid_search_with_mmr_raises with a new test that
asserts NearestQuery + MMR is passed in the dense prefetch
* feat: add hybrid search test with MMR grouped prefetch functionality
---------
Co-authored-by: srimon12 <srimon12mckv.gmail.com>1 parent ed49eb1 commit a5f9543
2 files changed
Lines changed: 60 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
872 | 872 | | |
873 | 873 | | |
874 | 874 | | |
875 | | - | |
| 875 | + | |
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
| |||
1460 | 1460 | | |
1461 | 1461 | | |
1462 | 1462 | | |
1463 | | - | |
1464 | | - | |
1465 | 1463 | | |
1466 | 1464 | | |
1467 | 1465 | | |
| |||
1635 | 1633 | | |
1636 | 1634 | | |
1637 | 1635 | | |
1638 | | - | |
| 1636 | + | |
1639 | 1637 | | |
1640 | 1638 | | |
1641 | 1639 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1242 | 1242 | | |
1243 | 1243 | | |
1244 | 1244 | | |
1245 | | - | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
1246 | 1250 | | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
1247 | 1261 | | |
1248 | 1262 | | |
1249 | 1263 | | |
1250 | 1264 | | |
1251 | 1265 | | |
1252 | 1266 | | |
1253 | | - | |
| 1267 | + | |
1254 | 1268 | | |
1255 | | - | |
1256 | | - | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
1257 | 1311 | | |
1258 | 1312 | | |
1259 | 1313 | | |
| |||
0 commit comments