Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.stream.Collectors;

import org.jspecify.annotations.Nullable;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -91,7 +90,7 @@ private void verifyDocumentsDeleted(VectorStore vectorStore, List<String> delete
List<Document> results = vectorStore
.similaritySearch(SearchRequest.builder().query("The World").topK(10).similarityThresholdAll().build());

List<String> foundIds = results.stream().map(Document::getId).collect(Collectors.toList());
List<String> foundIds = results.stream().map(Document::getId).toList();

assertThat(foundIds).doesNotContainAnyElementsOf(deletedIds);
});
Expand Down Expand Up @@ -130,7 +129,7 @@ protected void deleteWithStringFilterExpression() {
List<String> bgDocIds = documents.stream()
.filter(d -> "BG".equals(d.getMetadata().get("country")))
.map(Document::getId)
.collect(Collectors.toList());
.toList();

vectorStore.delete("country == 'BG'");
verifyDocumentsDeleted(vectorStore, bgDocIds);
Expand All @@ -154,7 +153,7 @@ protected void deleteByFilter() {
List<String> bgDocIds = documents.stream()
.filter(d -> "BG".equals(d.getMetadata().get("country")))
.map(Document::getId)
.collect(Collectors.toList());
.toList();

Filter.Expression filterExpression = new Filter.Expression(Filter.ExpressionType.EQ,
new Filter.Key("country"), new Filter.Value("BG"));
Expand Down