From 9f583eaed00045594c9f464286dc4557a1f9dfd0 Mon Sep 17 00:00:00 2001 From: jlonge4 Date: Mon, 22 Apr 2024 19:30:07 -0400 Subject: [PATCH] move keyword index to init --- .../document_stores/pgvector/document_store.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/integrations/pgvector/src/haystack_integrations/document_stores/pgvector/document_store.py b/integrations/pgvector/src/haystack_integrations/document_stores/pgvector/document_store.py index 469f2b24e..c38320874 100644 --- a/integrations/pgvector/src/haystack_integrations/document_stores/pgvector/document_store.py +++ b/integrations/pgvector/src/haystack_integrations/document_stores/pgvector/document_store.py @@ -528,8 +528,11 @@ def _keyword_retrieval( FROM {table_name}, plainto_tsquery({language}, {query}) query WHERE to_tsvector({language}, content) @@ query {where_clause} LIMIT {top_k}""" ).format( - table_name=Identifier(self.table_name), language=self.language, query=SQLLiteral(user_query), top_k=top_k, - where_clause=sql_where_clause + table_name=Identifier(self.table_name), + language=self.language, + query=SQLLiteral(user_query), + top_k=top_k, + where_clause=sql_where_clause, ) result = self._execute_sql(