-
Couldn't load subscription status.
- Fork 102
feat: add async and sync hybrid search index creation methods #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add async and sync hybrid search index creation methods #244
Conversation
|
@JHSeo-git Thank you opening this PR. Could you please add units tests similar to the ones that exist for the AsyncPGVectorStore shown here. |
c194523 to
49a79cc
Compare
- update postgres_db name for test in DEVELOPMENT.md - update postgres_port for test in utils.py - add psycopg[binary] for test using binary psycopg
|
@dishaprakash Thanks for the feedback 😄! I’ve added unit tests similar to the existing AsyncPGVectorStore ones, along with a few related configuration updates. Let me know if there’s anything else you’d like to see covered. |
- add tests for creating and validating hybrid search indexes using HybridSearchConfig - add tests for applying hybrid search indexes to tables with and without TSV columns - add tests for applying hybrid search indexes in both async and sync versions - add hybrid table cleanup logic to existing tests
eab90c1 to
702d6dd
Compare
tests/utils.py
Outdated
| POSTGRES_DB = os.environ.get("POSTGRES_DB", "langchain_test") | ||
|
|
||
| POSTGRES_PORT = os.environ.get("POSTGRES_PORT", "5432") | ||
| POSTGRES_PORT = os.environ.get("POSTGRES_PORT", "6024") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done revert
See #238 for details.
Added code to expose the functions (aapply_hybrid_search_index, apply_hybrid_search_index) for adding an index to the tsv column in hybrid search.
I also fixed minor typos in the existing test code for better readability.
langchain_postgres/v2/vectorstores.py: Added new index creation methodstests/unit_tests/v2/test_pg_vectorstore_index.py: Added comprehensive test coveragepyproject.toml: Updated test dependenciestests/utils.py: Minor updatesDEVELOPMENT.md: Minor updatesIt also includes changes to align test-related environment variable settings between
DEVELOPMENT.mdandutils.py.For testing, I initially attempted to use the existing dependency
psycopg, but on my current environment (not installed deps like libpq, MacBook Apple M4 Max), running with the existing dependency caused errors. To ensure compatibility across environments, I addedpsycopg[binary].psycopg error