Add filter-based deletion and string filter API to VectorStore
Add string-based filter deletion alongside the Filter.Expression-based deletion for vector stores. This provides a more convenient API for simple filter cases while maintaining the full flexibility of expression-based filtering. Key changes: - Add delete(Filter.Expression) and delete(String) methods to VectorStore - Add default string filter implementation in VectorStore interface - Implement filter deletion in Chroma/Elasticsearch/PgVector stores - Add integration tests for both filter APIs across implementations This extends vector store deletion capabilities while maintaining consistent behavior across implementations.
This commit is contained in:
committed by
Mark Pollack
parent
7521cab9db
commit
f588716b41
@@ -27,12 +27,20 @@ Spring AI offers an abstracted API for interacting with vector databases through
|
||||
Here is the `VectorStore` interface definition:
|
||||
|
||||
```java
|
||||
public interface VectorStore {
|
||||
public interface VectorStore extends DocumentWriter {
|
||||
|
||||
default String getName() {
|
||||
return this.getClass().getSimpleName();
|
||||
}
|
||||
|
||||
void add(List<Document> documents);
|
||||
|
||||
Optional<Boolean> delete(List<String> idList);
|
||||
|
||||
void delete(Filter.Expression filterExpression);
|
||||
|
||||
default void delete(String filterExpression) { ... };
|
||||
|
||||
List<Document> similaritySearch(String query);
|
||||
|
||||
List<Document> similaritySearch(SearchRequest request);
|
||||
|
||||
Reference in New Issue
Block a user