[PR #244] [MERGED] feat: add async and sync hybrid search index creation methods #257

Closed
opened 2026-02-16 05:17:08 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langchain-postgres/pull/244
Author: @JHSeo-git
Created: 8/12/2025
Status: Merged
Merged: 8/19/2025
Merged by: @dishaprakash

Base: mainHead: add-apply-hybrid-search-index-in-vectorstore


📝 Commits (6)

  • 49a79cc feat: add async and sync hybrid search index creation methods
  • f532396 chore: update for test
  • 702d6dd test: add hybrid search index related tests
  • d69176d revert
  • 51fb40d fix: lint
  • d11d308 Merge branch 'main' into add-apply-hybrid-search-index-in-vectorstore

📊 Changes

5 files changed (+206 additions, -5 deletions)

View changed files

📝 DEVELOPMENT.md (+1 -1)
📝 langchain_postgres/v2/vectorstores.py (+18 -0)
📝 pyproject.toml (+1 -0)
📝 tests/unit_tests/v2/test_pg_vectorstore_index.py (+116 -3)
📝 uv.lock (+70 -1)

📄 Description

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.

-DEFAULT_TABLE_ASYNC = "default_sync" ...
+DEFAULT_TABLE_ASYNC = "default_async" ...
  • langchain_postgres/v2/vectorstores.py: Added new index creation methods
  • tests/unit_tests/v2/test_pg_vectorstore_index.py: Added comprehensive test coverage
  • pyproject.toml: Updated test dependencies
  • tests/utils.py: Minor updates
  • DEVELOPMENT.md: Minor updates

It also includes changes to align test-related environment variable settings between DEVELOPMENT.md and utils.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 added psycopg[binary].

psycopg error
    import_from_libpq()
.venv/lib/python3.13/site-packages/psycopg/pq/__init__.py:108: in import_from_libpq
    raise ImportError(
E   ImportError: no pq wrapper available.
E   Attempts made:
E   - couldn't import psycopg 'c' implementation: No module named 'psycopg_c'

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langchain-postgres/pull/244 **Author:** [@JHSeo-git](https://github.com/JHSeo-git) **Created:** 8/12/2025 **Status:** ✅ Merged **Merged:** 8/19/2025 **Merged by:** [@dishaprakash](https://github.com/dishaprakash) **Base:** `main` ← **Head:** `add-apply-hybrid-search-index-in-vectorstore` --- ### 📝 Commits (6) - [`49a79cc`](https://github.com/langchain-ai/langchain-postgres/commit/49a79cce890a943dd75ebe01497b9ddfc952f0b4) feat: add async and sync hybrid search index creation methods - [`f532396`](https://github.com/langchain-ai/langchain-postgres/commit/f532396e968a06d813892af39d0ef25d82c456eb) chore: update for test - [`702d6dd`](https://github.com/langchain-ai/langchain-postgres/commit/702d6dd0fb4ed137ab90a09968e061506695fdcb) test: add hybrid search index related tests - [`d69176d`](https://github.com/langchain-ai/langchain-postgres/commit/d69176d0a264670fa27f5cbd95dae9c9301bfb3c) revert - [`51fb40d`](https://github.com/langchain-ai/langchain-postgres/commit/51fb40d99fb0e7f91a492b248f07eb9f6462547d) fix: lint - [`d11d308`](https://github.com/langchain-ai/langchain-postgres/commit/d11d3082bbec98c10fde2b980b6e4d7559dd05a4) Merge branch 'main' into add-apply-hybrid-search-index-in-vectorstore ### 📊 Changes **5 files changed** (+206 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `DEVELOPMENT.md` (+1 -1) 📝 `langchain_postgres/v2/vectorstores.py` (+18 -0) 📝 `pyproject.toml` (+1 -0) 📝 `tests/unit_tests/v2/test_pg_vectorstore_index.py` (+116 -3) 📝 `uv.lock` (+70 -1) </details> ### 📄 Description 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. ```diff -DEFAULT_TABLE_ASYNC = "default_sync" ... +DEFAULT_TABLE_ASYNC = "default_async" ... ``` - `langchain_postgres/v2/vectorstores.py`: Added new index creation methods - `tests/unit_tests/v2/test_pg_vectorstore_index.py`: Added comprehensive test coverage - `pyproject.toml`: Updated test dependencies - `tests/utils.py`: Minor updates - `DEVELOPMENT.md`: Minor updates It also includes changes to align test-related environment variable settings between `DEVELOPMENT.md` and `utils.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 added `psycopg[binary]`. <details> <summary> psycopg error </summary> ```bash import_from_libpq() .venv/lib/python3.13/site-packages/psycopg/pq/__init__.py:108: in import_from_libpq raise ImportError( E ImportError: no pq wrapper available. E Attempts made: E - couldn't import psycopg 'c' implementation: No module named 'psycopg_c' ``` </details> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 05:17:08 -05:00
yindo closed this issue 2026-02-16 05:17:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langchain-postgres#257