llama-index-vector-stores-postgres 0.2.5__tar.gz → 0.2.6__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.1
2
2
  Name: llama-index-vector-stores-postgres
3
- Version: 0.2.5
3
+ Version: 0.2.6
4
4
  Summary: llama-index vector_stores postgres integration
5
5
  License: MIT
6
6
  Author: Your Name
@@ -462,6 +462,8 @@ class PGVectorStore(BasePydanticVectorStore):
462
462
  return "NOT IN"
463
463
  elif operator == FilterOperator.CONTAINS:
464
464
  return "@>"
465
+ elif operator == FilterOperator.TEXT_MATCH:
466
+ return "LIKE"
465
467
  else:
466
468
  _logger.warning(f"Unknown operator: {operator}, fallback to '='")
467
469
  return "="
@@ -488,6 +490,13 @@ class PGVectorStore(BasePydanticVectorStore):
488
490
  f"{self._to_postgres_operator(filter_.operator)} "
489
491
  f"'[\"{filter_.value}\"]'"
490
492
  )
493
+ elif filter_.operator == FilterOperator.TEXT_MATCH:
494
+ # Where the operator is text_match, we need to wrap the filter in '%' characters
495
+ return text(
496
+ f"metadata_->>'{filter_.key}' "
497
+ f"{self._to_postgres_operator(filter_.operator)} "
498
+ f"'%{filter_.value}%'"
499
+ )
491
500
  else:
492
501
  # Check if value is a number. If so, cast the metadata value to a float
493
502
  # This is necessary because the metadata is stored as a string
@@ -27,7 +27,7 @@ exclude = ["**/BUILD"]
27
27
  license = "MIT"
28
28
  name = "llama-index-vector-stores-postgres"
29
29
  readme = "README.md"
30
- version = "0.2.5"
30
+ version = "0.2.6"
31
31
 
32
32
  [tool.poetry.dependencies]
33
33
  python = ">=3.8.1,<4.0"