Commit 396282f
authored
fix: Fix hybrid search bugs (#257)
This PR fixes the 2nd Major issue in
#234, related
to Configuration and Querying Issues
Issue breakdown:
-
**Inconsistent k Parameter:** For hybrid searches, the dense search
LIMIT was tied to the final k parameter, while the sparse search used
its own secondary_top_k.
**Late Initialization of HybridSearchConfig:** The HybridSearchConfig
was initialized after the k parameter was calculated, which could lead
to incorrect behavior if the config was passed dynamically via `kwargs`.
Overview of the changes:
-
1. The __query_collection method now uses a separate `dense_limit` for
the dense search query.
If HybridSearchConfig is active, dense_limit is set to primary_top_k.
For dense-only searches, dense_limit defaults to the final k value,
preserving the existing behavior.
2. The hybrid_search_config is now initialized at the beginning of
`__query_collection`, ensuring that any `kwargs` overrides are handled
before `k` or `dense_limit` are calculated.1 parent f8de351 commit 396282f
1 file changed
+13
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
593 | 593 | | |
594 | 594 | | |
595 | 595 | | |
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
620 | | - | |
| 620 | + | |
621 | 621 | | |
622 | | - | |
| 622 | + | |
623 | 623 | | |
624 | 624 | | |
625 | 625 | | |
| |||
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | 640 | | |
644 | 641 | | |
645 | 642 | | |
646 | 643 | | |
647 | 644 | | |
648 | 645 | | |
649 | | - | |
| 646 | + | |
650 | 647 | | |
651 | 648 | | |
652 | 649 | | |
| |||
0 commit comments