Expose aapply_hybrid_search_index in PGVectorStore #83

Closed
opened 2026-02-16 05:16:29 -05:00 by yindo · 1 comment
Owner

Originally created by @JHSeo-git on GitHub (Jul 31, 2025).

Originally assigned to: @dishaprakash on GitHub.

I'm currently using langchain_postgres and found that the method aapply_hybrid_search_index is implemented in langchain_postgres/v2/async_vectorstore.py,

# langchain_postgres/v2/async_vectorstore.py

async def aapply_hybrid_search_index(
        self,
        concurrently: bool = False,
    )

but it's not exposed through the PGVectorStore interface.
Because of this, there's no way to apply the hybrid search index when working with a PGVectorStore instance created via PGVectorStore.create().

To address this, I’d like to suggest exposing aapply_hybrid_search_index on PGVectorStore:

# langchain_postgres/v2/vectorstores.py
...

+    async def aapply_hybrid_search_index(
+        self,
+        concurrently: bool = False,
+    ) -> None:
+        """Apply the hybrid search index."""
+        return await self._engine._run_as_async(self.__vs.aapply_hybrid_search_index(concurrently=concurrently))
+
+    def apply_hybrid_search_index(
+        self, 
+        concurrently: bool = False,
+    ) -> None:
+        """Apply the hybrid search index."""
+        return self._engine._run_as_sync(self.__vs.aapply_hybrid_search_index(concurrently=concurrently))

...

Thanks for the great work on this library!

Originally created by @JHSeo-git on GitHub (Jul 31, 2025). Originally assigned to: @dishaprakash on GitHub. I'm currently using `langchain_postgres` and found that the method `aapply_hybrid_search_index` is implemented in `langchain_postgres/v2/async_vectorstore.py`, ```python # langchain_postgres/v2/async_vectorstore.py async def aapply_hybrid_search_index( self, concurrently: bool = False, ) ``` but it's not exposed through the `PGVectorStore` interface. Because of this, there's no way to apply the hybrid search index when working with a `PGVectorStore` instance created via `PGVectorStore.create()`. To address this, I’d like to suggest exposing `aapply_hybrid_search_index` on `PGVectorStore`: ```diff # langchain_postgres/v2/vectorstores.py ... + async def aapply_hybrid_search_index( + self, + concurrently: bool = False, + ) -> None: + """Apply the hybrid search index.""" + return await self._engine._run_as_async(self.__vs.aapply_hybrid_search_index(concurrently=concurrently)) + + def apply_hybrid_search_index( + self, + concurrently: bool = False, + ) -> None: + """Apply the hybrid search index.""" + return self._engine._run_as_sync(self.__vs.aapply_hybrid_search_index(concurrently=concurrently)) ... ``` Thanks for the great work on this library!
yindo closed this issue 2026-02-16 05:16:29 -05:00
Author
Owner

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

Closing this issue since the PR https://github.com/langchain-ai/langchain-postgres/pull/244 was merged.

@dishaprakash commented on GitHub (Aug 19, 2025): Closing this issue since the PR https://github.com/langchain-ai/langchain-postgres/pull/244 was merged.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langchain-postgres#83