llama-index-vector-stores-postgres 0.6.2__tar.gz → 0.6.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llama-index-vector-stores-postgres
3
- Version: 0.6.2
3
+ Version: 0.6.4
4
4
  Summary: llama-index vector_stores postgres integration
5
5
  Author-email: Your Name <you@example.com>
6
6
  License-Expression: MIT
@@ -873,8 +873,11 @@ class PGVectorStore(BasePydanticVectorStore):
873
873
  if query_str is None:
874
874
  raise ValueError("query_str must be specified for a sparse vector query.")
875
875
 
876
- # Remove "&", "|" and collapse multiple spaces ("&" and "|" are used by ts_query)
877
- query_str = re.sub(r"\s*(?:[|&]|\s)\s*", " ", query_str).strip()
876
+ # Remove special characters used by ts_query
877
+ query_str = re.sub(r"[&|!:*()'<>]", " ", query_str)
878
+
879
+ # Collapse multiple spaces
880
+ query_str = re.sub(r"\s+", " ", query_str).strip()
878
881
 
879
882
  # Replace space with "|" to perform an OR search for higher recall
880
883
  query_str = query_str.replace(" ", "|")
@@ -1067,7 +1070,7 @@ class PGVectorStore(BasePydanticVectorStore):
1067
1070
  self._initialize()
1068
1071
  with self._session() as session, session.begin():
1069
1072
  stmt = delete(self._table_class).where(
1070
- self._table_class.metadata_["doc_id"].astext == ref_doc_id
1073
+ self._table_class.metadata_["ref_doc_id"].astext == ref_doc_id
1071
1074
  )
1072
1075
 
1073
1076
  session.execute(stmt)
@@ -1079,7 +1082,7 @@ class PGVectorStore(BasePydanticVectorStore):
1079
1082
  self._initialize()
1080
1083
  async with self._async_session() as session, session.begin():
1081
1084
  stmt = delete(self._table_class).where(
1082
- self._table_class.metadata_["doc_id"].astext == ref_doc_id
1085
+ self._table_class.metadata_["ref_doc_id"].astext == ref_doc_id
1083
1086
  )
1084
1087
 
1085
1088
  await session.execute(stmt)
@@ -27,7 +27,7 @@ dev = [
27
27
 
28
28
  [project]
29
29
  name = "llama-index-vector-stores-postgres"
30
- version = "0.6.2"
30
+ version = "0.6.4"
31
31
  description = "llama-index vector_stores postgres integration"
32
32
  authors = [{name = "Your Name", email = "you@example.com"}]
33
33
  requires-python = ">=3.9,<4.0"