Skip to content

The agent engineering platform.

community: make `SET allow_experimental_[engine]_index` configurabe in vectorstores.clickhouse (#18107)

GoodBai3589a135ef7f
diff --git a/libs/community/langchain_community/vectorstores/clickhouse.py b/libs/community/langchain_community/vectorstores/clickhouse.py
index 4b8628daf7..816ccd2aac 100644
--- a/libs/community/langchain_community/vectorstores/clickhouse.py
+++ b/libs/community/langchain_community/vectorstores/clickhouse.py
@@ -205,8 +205,8 @@ CREATE TABLE IF NOT EXISTS {self.config.database}.{self.config.table}(
)
# Enable JSON type
self.client.command("SET allow_experimental_object_type=1")
- # Enable Annoy index
- self.client.command("SET allow_experimental_annoy_index=1")
+ # Enable index
+ self.client.command(f"SET allow_experimental_{self.config.index_type}_index=1")
self.client.command(self.schema)
@property