Skip to content

Expose aapply_hybrid_search_index in PGVectorStore #238

@JHSeo-git

Description

@JHSeo-git

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!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions