pgvector-haystack 1.2.0__py3-none-any.whl → 1.3.0__py3-none-any.whl

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.
@@ -389,7 +389,9 @@ class PgvectorDocumentStore:
389
389
  )
390
390
  return
391
391
 
392
- sql_drop_index = SQL("DROP INDEX IF EXISTS {index_name}").format(index_name=Identifier(self.hnsw_index_name))
392
+ sql_drop_index = SQL("DROP INDEX IF EXISTS {schema_name}.{index_name}").format(
393
+ schema_name=Identifier(self.schema_name), index_name=Identifier(self.hnsw_index_name)
394
+ )
393
395
  self._execute_sql(sql_drop_index, error_msg="Could not drop HNSW index")
394
396
 
395
397
  self._create_hnsw_index()
@@ -232,6 +232,20 @@ def _in(field: str, value: Any) -> Tuple[str, List]:
232
232
  return f"{field} = ANY(%s)", [value]
233
233
 
234
234
 
235
+ def _like(field: str, value: Any) -> Tuple[str, Any]:
236
+ if not isinstance(value, str):
237
+ msg = f"{field}'s value must be a str when using 'LIKE' "
238
+ raise FilterError(msg)
239
+ return f"{field} LIKE %s", value
240
+
241
+
242
+ def _not_like(field: str, value: Any) -> Tuple[str, Any]:
243
+ if not isinstance(value, str):
244
+ msg = f"{field}'s value must be a str when using 'LIKE' "
245
+ raise FilterError(msg)
246
+ return f"{field} NOT LIKE %s", value
247
+
248
+
235
249
  COMPARISON_OPERATORS = {
236
250
  "==": _equal,
237
251
  "!=": _not_equal,
@@ -241,4 +255,6 @@ COMPARISON_OPERATORS = {
241
255
  "<=": _less_than_equal,
242
256
  "in": _in,
243
257
  "not in": _not_in,
258
+ "like": _like,
259
+ "not like": _not_like,
244
260
  }
@@ -1,12 +1,13 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: pgvector-haystack
3
- Version: 1.2.0
3
+ Version: 1.3.0
4
4
  Summary: An integration of pgvector (vector search extension for Postgres) with Haystack
5
5
  Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations
6
6
  Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/pgvector/README.md
7
7
  Project-URL: Issues, https://github.com/deepset-ai/haystack-core-integrations/issues
8
8
  Author-email: deepset GmbH <info@deepset.ai>
9
- License: Apache-2.0
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE.txt
10
11
  Classifier: Development Status :: 4 - Beta
11
12
  Classifier: License :: OSI Approved :: Apache Software License
12
13
  Classifier: Programming Language :: Python
@@ -47,7 +48,7 @@ pip install pgvector-haystack
47
48
 
48
49
  Ensure that you have a PostgreSQL running with the `pgvector` extension. For a quick setup using Docker, run:
49
50
  ```
50
- docker run -d -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres ankane/pgvector
51
+ docker run -d -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres pgvector/pgvector:pg17
51
52
  ```
52
53
 
53
54
  then run the tests:
@@ -2,9 +2,9 @@ haystack_integrations/components/retrievers/pgvector/__init__.py,sha256=n4q4pUAp
2
2
  haystack_integrations/components/retrievers/pgvector/embedding_retriever.py,sha256=IEIdgKy_IWgmL5Qy_Hqkwa2mq2JxnQ_JOdjm38JPxmE,7530
3
3
  haystack_integrations/components/retrievers/pgvector/keyword_retriever.py,sha256=SYHqjTkDczobYZ2qq0z8yS9p_g8aINnzwA5AN_nKdHI,5632
4
4
  haystack_integrations/document_stores/pgvector/__init__.py,sha256=Ge-7ggarfr3x8UqNdFHUuFGiu52u49sOVe3l16WEwZU,197
5
- haystack_integrations/document_stores/pgvector/document_store.py,sha256=A1dPiRrApVF33RahgzwijB9AmmMam2MY8dDBJ6n-SU4,31362
6
- haystack_integrations/document_stores/pgvector/filters.py,sha256=751_Z1QnXJCG0GWC2jcfeZ25NNYfJewQEIUCeJS70PA,8212
7
- pgvector_haystack-1.2.0.dist-info/METADATA,sha256=4Tjkp15AB48A32tpNk2NWv-3GL9kWlAk3AXx0KH1ork,2182
8
- pgvector_haystack-1.2.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
9
- pgvector_haystack-1.2.0.dist-info/licenses/LICENSE.txt,sha256=B05uMshqTA74s-0ltyHKI6yoPfJ3zYgQbvcXfDVGFf8,10280
10
- pgvector_haystack-1.2.0.dist-info/RECORD,,
5
+ haystack_integrations/document_stores/pgvector/document_store.py,sha256=Ni9Cg9sXdsVBhuTNFhtSbJMkMNYORAlYLqcKM1lR96M,31440
6
+ haystack_integrations/document_stores/pgvector/filters.py,sha256=rBRgDFXMSElRDOtiBkkHlheDV445HVGl-ufXRYKQaXs,8716
7
+ pgvector_haystack-1.3.0.dist-info/METADATA,sha256=QuGnYE1syuoWC_L9-yL1Ew5j6mMl03hfHUXG_6p5PRs,2226
8
+ pgvector_haystack-1.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
+ pgvector_haystack-1.3.0.dist-info/licenses/LICENSE.txt,sha256=B05uMshqTA74s-0ltyHKI6yoPfJ3zYgQbvcXfDVGFf8,10280
10
+ pgvector_haystack-1.3.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.26.3
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any