Skip to content

feat: adds hybrid search for async VS interface [3/N] #416

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

Closed
wants to merge 1 commit into from

Conversation

vishwarajanand
Copy link
Contributor

Adds hybrid search in async vector store.

Key features:

  • Insert (actually an upsert) a document with TSV column
  • Search when hybrid config is provided, in both the following cases:
    • With TSV column
    • Without TSV column

@product-auto-label product-auto-label bot added the api: alloydb Issues related to the googleapis/langchain-google-alloydb-pg-python API. label May 6, 2025
@vishwarajanand vishwarajanand changed the title feat: adds hybrid search for async VS interface feat: adds hybrid search for async VS interface [3/N] May 6, 2025
@@ -898,13 +1001,20 @@ async def aapply_vector_index(
index.name = self.table_name + DEFAULT_INDEX_NAME_SUFFIX
name = index.name
stmt = f"CREATE INDEX {'CONCURRENTLY' if concurrently else ''} {name} ON \"{self.schema_name}\".\"{self.table_name}\" USING {index.index_type} ({self.embedding_column} {function}) {params} {filter};"
tsv_index_query = (
f'CREATE INDEX IF NOT EXISTS {self.hybrid_search_config.index_name} ON table_name USING {self.hybrid_search_config.index_type}("{self.content_column}");'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f'CREATE INDEX IF NOT EXISTS {self.hybrid_search_config.index_name} ON table_name USING {self.hybrid_search_config.index_type}("{self.content_column}");'
f'CREATE INDEX {'CONCURRENTLY' if concurrently else ''} IF NOT EXISTS {self.hybrid_search_config.index_name} ON table_name USING {self.hybrid_search_config.index_type}("{self.content_column}");'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to cloned PR

@vishwarajanand
Copy link
Contributor Author

PRs have been moved over to langchain-postgres repo. Pls follow #414

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: alloydb Issues related to the googleapis/langchain-google-alloydb-pg-python API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants