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.
- {llama_index_vector_stores_postgres-0.2.5 → llama_index_vector_stores_postgres-0.2.6}/PKG-INFO +1 -1
- {llama_index_vector_stores_postgres-0.2.5 → llama_index_vector_stores_postgres-0.2.6}/llama_index/vector_stores/postgres/base.py +9 -0
- {llama_index_vector_stores_postgres-0.2.5 → llama_index_vector_stores_postgres-0.2.6}/pyproject.toml +1 -1
- {llama_index_vector_stores_postgres-0.2.5 → llama_index_vector_stores_postgres-0.2.6}/README.md +0 -0
- {llama_index_vector_stores_postgres-0.2.5 → llama_index_vector_stores_postgres-0.2.6}/llama_index/py.typed +0 -0
- {llama_index_vector_stores_postgres-0.2.5 → llama_index_vector_stores_postgres-0.2.6}/llama_index/vector_stores/postgres/__init__.py +0 -0
|
@@ -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
|
{llama_index_vector_stores_postgres-0.2.5 → llama_index_vector_stores_postgres-0.2.6}/README.md
RENAMED
|
File without changes
|
|
File without changes
|