ragleap-vectorstores (Java) 0.2.0
Tenant filter fix for the Redis, OpenSearch and Upstash backends: a port of the Python fix in ragleap-vectorstores 0.7.0 (PR #1502).
Before (0.1.0): RedisBackend ignored every metadata filter key except document_id, so a tenant_id filter searched all tenants; OpenSearchBackend matched nothing for a tenant_id filter; UpstashBackend put the filter keys into the filter string unchecked.
Now:
- RedisBackend: the index has a tenant_id TAG field; only document_id and tenant_id can be filtered; any other key throws IllegalArgumentException. An existing index created by an older version (without the field) rejects a tenant_id filter with IllegalStateException: use a new indexName.
- OpenSearchBackend: tenant_id is a keyword field (also mapped on existing indexes); only document_id, document_name, tenant_id, chunk_index and token_count can be filtered; any other key throws IllegalArgumentException.
- UpstashBackend: filter keys must be identifiers (letters, digits, underscore and dot, not starting with a digit), otherwise IllegalArgumentException.
Behaviour change: an unknown filter key now throws (Redis ignored it, OpenSearch matched nothing).
Verified against recordings of the real Python code (29, 32 and 41 scenarios) and by 44 of 44 mutations killed. Not verified against live Redis, OpenSearch or Upstash servers.
Maven: io.github.antonyrag:ragleap-vectorstores:0.2.0