[Documentation] Indicate dense vs sparse search in HybridSearchConfig #80

Closed
opened 2026-02-16 05:16:29 -05:00 by yindo · 3 comments
Owner

Originally created by @alberto-agudo on GitHub (Jul 4, 2025).

Originally assigned to: @dishaprakash on GitHub.

The current configuration of HybridSearch mentions primary_search and secondary_search:
https://github.com/langchain-ai/langchain-postgres/blob/18b1bcdb75ed152da717e3d624e1ed822d17d60f/langchain_postgres/v2/hybrid_search_config.py#L19-L22

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:

https://github.com/langchain-ai/langchain-postgres/blob/18b1bcdb75ed152da717e3d624e1ed822d17d60f/langchain_postgres/v2/async_vectorstore.py#L669-L673

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.

Originally created by @alberto-agudo on GitHub (Jul 4, 2025). Originally assigned to: @dishaprakash on GitHub. The current configuration of HybridSearch mentions primary_search and secondary_search: https://github.com/langchain-ai/langchain-postgres/blob/18b1bcdb75ed152da717e3d624e1ed822d17d60f/langchain_postgres/v2/hybrid_search_config.py#L19-L22 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: https://github.com/langchain-ai/langchain-postgres/blob/18b1bcdb75ed152da717e3d624e1ed822d17d60f/langchain_postgres/v2/async_vectorstore.py#L669-L673 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.
yindo closed this issue 2026-02-16 05:16:29 -05:00
Author
Owner

@dishaprakash commented on GitHub (Aug 19, 2025):

@alberto-agudo Thank you for opening the issue! We have recently updated the documentation for Hybrid Search. For more information see the how-to guide.

@dishaprakash commented on GitHub (Aug 19, 2025): @alberto-agudo Thank you for opening the issue! We have recently updated the documentation for Hybrid Search. For more information see the [how-to guide](https://github.com/langchain-ai/langchain-postgres/blob/main/examples/pg_vectorstore_how_to.ipynb).
Author
Owner

@alberto-agudo commented on GitHub (Aug 26, 2025):

@dishaprakash Thanks for the new docs! They seem quite helpful. In any case, I think it would be worth adding a small comment to the how-to guide mentioning that primary=dense (embedding-based) and secondary=sparse (full-text based).

@alberto-agudo commented on GitHub (Aug 26, 2025): @dishaprakash Thanks for the new docs! They seem quite helpful. In any case, I think it would be worth adding a small comment to the how-to guide mentioning that primary=dense (embedding-based) and secondary=sparse (full-text based).
Author
Owner

@dishaprakash commented on GitHub (Sep 17, 2025):

@alberto-agudo This has been resolved in https://github.com/langchain-ai/langchain-postgres/pull/251.

Thank you for the contribution! Closing this issue now.

@dishaprakash commented on GitHub (Sep 17, 2025): @alberto-agudo This has been resolved in https://github.com/langchain-ai/langchain-postgres/pull/251. Thank you for the contribution! Closing this issue now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langchain-postgres#80