fix bugs(when using Oracle23ai as Vector DB) (#6658)

This commit is contained in:
tmuife 2024-07-25 17:07:14 +08:00 committed by GitHub
parent 75e6576c67
commit 16b4f560cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -55,7 +55,7 @@ CREATE TABLE IF NOT EXISTS {table_name} (
) )
""" """
SQL_CREATE_INDEX = """ SQL_CREATE_INDEX = """
CREATE INDEX idx_docs_{table_name} ON {table_name}(text) CREATE INDEX IF NOT EXISTS idx_docs_{table_name} ON {table_name}(text)
INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS
('FILTER CTXSYS.NULL_FILTER SECTION GROUP CTXSYS.HTML_SECTION_GROUP LEXER sys.my_chinese_vgram_lexer') ('FILTER CTXSYS.NULL_FILTER SECTION GROUP CTXSYS.HTML_SECTION_GROUP LEXER sys.my_chinese_vgram_lexer')
""" """
@ -248,7 +248,7 @@ class OracleVector(BaseVector):
def delete(self) -> None: def delete(self) -> None:
with self._get_cursor() as cur: with self._get_cursor() as cur:
cur.execute(f"DROP TABLE IF EXISTS {self.table_name}") cur.execute(f"DROP TABLE IF EXISTS {self.table_name} cascade constraints")
def _create_collection(self, dimension: int): def _create_collection(self, dimension: int):
cache_key = f"vector_indexing_{self._collection_name}" cache_key = f"vector_indexing_{self._collection_name}"