-
Couldn't load subscription status.
- Fork 102
Description
The current configuration of HybridSearch mentions primary_search and secondary_search:
langchain-postgres/langchain_postgres/v2/hybrid_search_config.py
Lines 19 to 22 in 18b1bcd
| primary_search_results: A list of (document, distance) tuples from | |
| the primary search. | |
| secondary_search_results: A list of (document, distance) tuples from | |
| the secondary search. |
Even if you'd think primary search is dense (embeddings-based) and secondary is sparse (keyword-based), there's no guarantee in the class definition that it works this way. There's no need to mention this in the actual function arguments, but I think it is necessary in the docstring.
I didn't realize the actual meaning of primary and secondary until I found the following lines when digging in the code:
langchain-postgres/langchain_postgres/v2/async_vectorstore.py
Lines 669 to 673 in 18b1bcd
| combined_results = hybrid_search_config.fusion_function( | |
| dense_results, | |
| sparse_results, | |
| **hybrid_search_config.fusion_function_parameters, | |
| ) |
Due to the current lack of documentation, it would greatly help others with the current lack of documentation to just change these lines in the HybridSearchConfig definition.