Skip to content

Commit ecae78f

Browse files
author
Milder Hernandez
authored
Merge pull request #214 from milderhc/postgres-vector-search
Add PostgreSQL Vector Search
2 parents 6729109 + cc81f81 commit ecae78f

25 files changed

Lines changed: 925 additions & 649 deletions

api-test/integration-tests/src/test/java/com/microsoft/semantickernel/tests/connectors/memory/Hotel.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@ public class Hotel {
1919
@VectorStoreRecordDataAttribute()
2020
private final String description;
2121
@JsonProperty("summaryEmbedding")
22-
@VectorStoreRecordVectorAttribute(dimensions = 3)
22+
@VectorStoreRecordVectorAttribute(dimensions = 8)
2323
private final List<Float> descriptionEmbedding;
24-
@VectorStoreRecordVectorAttribute(dimensions = 3, indexKind = "hnsw", distanceFunction = "cosine")
25-
private final List<Float> additionalEmbedding;
24+
@JsonProperty("indexedSummaryEmbedding")
25+
@VectorStoreRecordVectorAttribute(dimensions = 8, indexKind = "hnsw", distanceFunction = "cosine")
26+
private final List<Float> indexedDescriptionEmbedding;
2627
@VectorStoreRecordDataAttribute
2728
private double rating;
2829

2930
public Hotel() {
30-
this(null, null, 0, null, null, 0.0);
31+
this(null, null, 0, null, null, null, 0.0);
3132
}
3233

3334
@JsonCreator
@@ -36,14 +37,15 @@ public Hotel(
3637
@JsonProperty("name") String name,
3738
@JsonProperty("code") int code,
3839
@JsonProperty("summary") String description,
39-
@JsonProperty("summaryVector") List<Float> descriptionEmbedding,
40+
@JsonProperty("summaryEmbedding") List<Float> descriptionEmbedding,
41+
@JsonProperty("indexedSummaryEmbedding") List<Float> indexedDescriptionEmbedding,
4042
@JsonProperty("rating") double rating) {
4143
this.id = id;
4244
this.name = name;
4345
this.code = code;
4446
this.description = description;
4547
this.descriptionEmbedding = descriptionEmbedding;
46-
this.additionalEmbedding = descriptionEmbedding;
48+
this.indexedDescriptionEmbedding = indexedDescriptionEmbedding;
4749
this.rating = rating;
4850
}
4951

@@ -66,8 +68,8 @@ public String getDescription() {
6668
public List<Float> getDescriptionEmbedding() {
6769
return descriptionEmbedding;
6870
}
69-
public List<Float> getAdditionalEmbedding() {
70-
return additionalEmbedding;
71+
public List<Float> getIndexedDescriptionEmbedding() {
72+
return indexedDescriptionEmbedding;
7173
}
7274

7375
public double getRating() {

api-test/integration-tests/src/test/java/com/microsoft/semantickernel/tests/connectors/memory/jdbc/JDBCVectorStoreRecordCollectionTest.java

Lines changed: 93 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
package com.microsoft.semantickernel.tests.connectors.memory.jdbc;
22

3-
import com.microsoft.semantickernel.connectors.data.jdbc.JDBCVectorStoreQueryProvider;
3+
import com.microsoft.semantickernel.connectors.data.jdbc.SQLVectorStoreQueryProvider;
44
import com.microsoft.semantickernel.connectors.data.jdbc.JDBCVectorStoreRecordCollection;
55
import com.microsoft.semantickernel.connectors.data.jdbc.JDBCVectorStoreRecordCollectionOptions;
66
import com.microsoft.semantickernel.connectors.data.mysql.MySQLVectorStoreQueryProvider;
77
import com.microsoft.semantickernel.connectors.data.postgres.PostgreSQLVectorStoreQueryProvider;
8+
import com.microsoft.semantickernel.data.vectorsearch.VectorSearchResult;
89
import com.microsoft.semantickernel.data.vectorstorage.options.GetRecordOptions;
10+
import com.microsoft.semantickernel.data.vectorstorage.options.VectorSearchOptions;
911
import com.microsoft.semantickernel.tests.connectors.memory.Hotel;
1012
import com.mysql.cj.jdbc.MysqlDataSource;
13+
import org.junit.jupiter.api.Test;
1114
import org.junit.jupiter.params.ParameterizedTest;
1215
import org.junit.jupiter.params.provider.EnumSource;
1316
import org.postgresql.ds.PGSimpleDataSource;
@@ -44,7 +47,7 @@ public enum QueryProvider {
4447
}
4548

4649
private JDBCVectorStoreRecordCollection<Hotel> buildRecordCollection(QueryProvider provider, @Nonnull String collectionName) {
47-
JDBCVectorStoreQueryProvider queryProvider;
50+
SQLVectorStoreQueryProvider queryProvider;
4851
DataSource dataSource;
4952

5053
switch (provider) {
@@ -93,12 +96,19 @@ public void buildRecordCollection(QueryProvider provider) {
9396
}
9497

9598
private List<Hotel> getHotels() {
99+
ArrayList<Hotel> embeddings = new ArrayList<>();
100+
96101
return List.of(
97-
new Hotel("id_1", "Hotel 1", 1, "Hotel 1 description", Arrays.asList(1.0f, 2.0f, 3.0f), 4.0),
98-
new Hotel("id_2", "Hotel 2", 2, "Hotel 2 description", Arrays.asList(1.0f, 2.0f, 3.0f), 3.0),
99-
new Hotel("id_3", "Hotel 3", 3, "Hotel 3 description", Arrays.asList(1.0f, 2.0f, 3.0f), 5.0),
100-
new Hotel("id_4", "Hotel 4", 4, "Hotel 4 description", Arrays.asList(1.0f, 2.0f, 3.0f), 4.0),
101-
new Hotel("id_5", "Hotel 5", 5, "Hotel 5 description", Arrays.asList(1.0f, 2.0f, 3.0f), 5.0)
102+
new Hotel("id_1", "Hotel 1", 1, "Hotel 1 description", Arrays.asList(0.5f, 3.2f, 7.1f, -4.0f, 2.8f, 10.0f, -1.3f, 5.5f),
103+
Arrays.asList(0.5f, 3.2f, 7.1f, -4.0f, 2.8f, 10.0f, -1.3f, 5.5f),4.0),
104+
new Hotel("id_2", "Hotel 2", 2, "Hotel 2 description", Arrays.asList(-2.0f, 8.1f, 0.9f, 5.4f, -3.3f, 2.2f, 9.9f, -4.5f),
105+
Arrays.asList(-2.0f, 8.1f, 0.9f, 5.4f, -3.3f, 2.2f, 9.9f, -4.5f),3.0),
106+
new Hotel("id_3", "Hotel 3", 3, "Hotel 3 description", Arrays.asList(4.5f, -6.2f, 3.1f, 7.7f, -0.8f, 1.1f, -2.2f, 8.3f),
107+
Arrays.asList(4.5f, -6.2f, 3.1f, 7.7f, -0.8f, 1.1f, -2.2f, 8.3f),5.0),
108+
new Hotel("id_4", "Hotel 4", 4, "Hotel 4 description", Arrays.asList(7.0f, 1.2f, -5.3f, 2.5f, 6.6f, -7.8f, 3.9f, -0.1f),
109+
Arrays.asList(7.0f, 1.2f, -5.3f, 2.5f, 6.6f, -7.8f, 3.9f, -0.1f),4.0),
110+
new Hotel("id_5", "Hotel 5", 5, "Hotel 5 description", Arrays.asList(-3.5f, 4.4f, -1.2f, 9.9f, 5.7f, -6.1f, 7.8f, -2.0f),
111+
Arrays.asList(-3.5f, 4.4f, -1.2f, 9.9f, 5.7f, -6.1f, 7.8f, -2.0f),5.0)
102112
);
103113
}
104114

@@ -306,4 +316,80 @@ public void getBatchWithNoVectors(QueryProvider provider) {
306316
assertNotNull(hotel.getDescriptionEmbedding());
307317
}
308318
}
319+
320+
321+
@Test
322+
public void postgresExactSearch() {
323+
String collectionName = "search";
324+
JDBCVectorStoreRecordCollection<Hotel> recordCollection = buildRecordCollection(QueryProvider.PostgreSQL, collectionName);
325+
326+
List<Hotel> hotels = getHotels();
327+
recordCollection.upsertBatchAsync(hotels, null).block();
328+
329+
// Embeddings similar to the third hotel
330+
List<Float> embeddings = Arrays.asList(4.5f, -6.2f, 3.1f, 7.7f, -0.8f, 1.1f, -2.2f, 8.2f);
331+
List<VectorSearchResult<Hotel>> results = recordCollection.searchAsync(embeddings, null).block();
332+
assertNotNull(results);
333+
assertEquals(3, results.size());
334+
// The third hotel should be the most similar
335+
assertEquals(hotels.get(2).getId(), results.get(0).getRecord().getId());
336+
337+
// Skip the first result
338+
results = recordCollection.searchAsync(embeddings, VectorSearchOptions.builder().withOffset(1).withLimit(-100).build()).block();
339+
assertNotNull(results);
340+
assertEquals(1, results.size());
341+
// The first hotel should be the most similar
342+
assertEquals(hotels.get(0).getId(), results.get(0).getRecord().getId());
343+
}
344+
345+
@Test
346+
public void postgresApproximateSearch() {
347+
String collectionName = "searchWithIndex";
348+
JDBCVectorStoreRecordCollection<Hotel> recordCollection = buildRecordCollection(QueryProvider.PostgreSQL, collectionName);
349+
350+
List<Hotel> hotels = getHotels();
351+
recordCollection.upsertBatchAsync(hotels, null).block();
352+
353+
VectorSearchOptions options = VectorSearchOptions.builder()
354+
.withVectorFieldName("indexedDescriptionEmbedding")
355+
.withLimit(5)
356+
.build();
357+
358+
// Embeddings similar to the third hotel
359+
List<Float> embeddings = Arrays.asList(4.5f, -6.2f, 3.1f, 7.7f, -0.8f, 1.1f, -2.2f, 8.2f);
360+
List<VectorSearchResult<Hotel>> results = recordCollection.searchAsync(embeddings, options).block();
361+
assertNotNull(results);
362+
assertEquals(5, results.size());
363+
// The third hotel should be the most similar
364+
assertEquals(hotels.get(2).getId(), results.get(0).getRecord().getId());
365+
}
366+
367+
@Test
368+
public void searchIncludeAndNotIncludeVectors() {
369+
String collectionName = "searchIncludeAndNotIncludeVectors";
370+
JDBCVectorStoreRecordCollection<Hotel> recordCollection = buildRecordCollection(QueryProvider.PostgreSQL, collectionName);
371+
372+
List<Hotel> hotels = getHotels();
373+
recordCollection.upsertBatchAsync(hotels, null).block();
374+
375+
// Embeddings similar to the third hotel
376+
List<Float> embeddings = Arrays.asList(4.5f, -6.2f, 3.1f, 7.7f, -0.8f, 1.1f, -2.2f, 8.2f);
377+
List<VectorSearchResult<Hotel>> results = recordCollection.searchAsync(embeddings, null).block();
378+
assertNotNull(results);
379+
assertEquals(3, results.size());
380+
// The third hotel should be the most similar
381+
assertEquals(hotels.get(2).getId(), results.get(0).getRecord().getId());
382+
assertNull(results.get(0).getRecord().getDescriptionEmbedding());
383+
384+
VectorSearchOptions options = VectorSearchOptions.builder()
385+
.withIncludeVectors(true)
386+
.build();
387+
388+
results = recordCollection.searchAsync(embeddings, options).block();
389+
assertNotNull(results);
390+
assertEquals(3, results.size());
391+
// The third hotel should be the most similar
392+
assertEquals(hotels.get(2).getId(), results.get(0).getRecord().getId());
393+
assertNotNull(results.get(0).getRecord().getDescriptionEmbedding());
394+
}
309395
}

api-test/integration-tests/src/test/java/com/microsoft/semantickernel/tests/connectors/memory/jdbc/JDBCVectorStoreTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import com.microsoft.semantickernel.connectors.data.jdbc.JDBCVectorStore;
44
import com.microsoft.semantickernel.connectors.data.jdbc.JDBCVectorStoreOptions;
5-
import com.microsoft.semantickernel.connectors.data.jdbc.JDBCVectorStoreQueryProvider;
5+
import com.microsoft.semantickernel.connectors.data.jdbc.SQLVectorStoreQueryProvider;
66
import com.microsoft.semantickernel.connectors.data.jdbc.JDBCVectorStoreRecordCollectionOptions;
77
import com.microsoft.semantickernel.connectors.data.mysql.MySQLVectorStoreQueryProvider;
88
import com.microsoft.semantickernel.connectors.data.postgres.PostgreSQLVectorStoreQueryProvider;
@@ -36,7 +36,7 @@ public class JDBCVectorStoreTest {
3636
private static final PostgreSQLContainer<?> POSTGRESQL_CONTAINER = new PostgreSQLContainer<>(PGVECTOR);
3737

3838
private JDBCVectorStore buildVectorStore(QueryProvider provider) {
39-
JDBCVectorStoreQueryProvider queryProvider;
39+
SQLVectorStoreQueryProvider queryProvider;
4040
DataSource dataSource;
4141

4242
switch (provider) {

api-test/integration-tests/src/test/java/com/microsoft/semantickernel/tests/connectors/memory/redis/RedisHashSetVectorStoreRecordCollectionTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ private RedisHashSetVectorStoreRecordCollection<Hotel> buildrecordCollection(@No
9797

9898
private List<Hotel> getHotels() {
9999
return List.of(
100-
new Hotel("id_1", "Hotel 1", 1, "Hotel 1 description", Arrays.asList(1.0f, 2.0f, 3.0f), 4.0),
101-
new Hotel("id_2", "Hotel 2", 2, "Hotel 2 description", Arrays.asList(1.0f, 2.0f, 3.0f), 3.0),
102-
new Hotel("id_3", "Hotel 3", 3, "Hotel 3 description", Arrays.asList(1.0f, 2.0f, 3.0f), 5.0),
103-
new Hotel("id_4", "Hotel 4", 4, "Hotel 4 description", Arrays.asList(1.0f, 2.0f, 3.0f), 4.0),
104-
new Hotel("id_5", "Hotel 5", 5, "Hotel 5 description", Arrays.asList(1.0f, 2.0f, 3.0f), 5.0)
100+
new Hotel("id_1", "Hotel 1", 1, "Hotel 1 description", Arrays.asList(1.0f, 2.0f, 3.0f), Arrays.asList(1.0f, 2.0f, 3.0f),4.0),
101+
new Hotel("id_2", "Hotel 2", 2, "Hotel 2 description", Arrays.asList(1.0f, 2.0f, 3.0f), Arrays.asList(1.0f, 2.0f, 3.0f),3.0),
102+
new Hotel("id_3", "Hotel 3", 3, "Hotel 3 description", Arrays.asList(1.0f, 2.0f, 3.0f), Arrays.asList(1.0f, 2.0f, 3.0f),5.0),
103+
new Hotel("id_4", "Hotel 4", 4, "Hotel 4 description", Arrays.asList(1.0f, 2.0f, 3.0f), Arrays.asList(1.0f, 2.0f, 3.0f),4.0),
104+
new Hotel("id_5", "Hotel 5", 5, "Hotel 5 description", Arrays.asList(1.0f, 2.0f, 3.0f), Arrays.asList(1.0f, 2.0f, 3.0f),5.0)
105105
);
106106
}
107107

@@ -233,7 +233,7 @@ public void getAsyncWithVectors(RecordCollectionOptions options) {
233233
recordCollection.upsertBatchAsync(hotels, null).block();
234234

235235
for (Hotel hotel : hotels) {
236-
Hotel retrievedHotel = recordCollection.getAsync(hotel.getId(), null).block();
236+
Hotel retrievedHotel = recordCollection.getAsync(hotel.getId(), new GetRecordOptions(true)).block();
237237
assertNotNull(retrievedHotel);
238238
assertNotNull(retrievedHotel.getDescriptionEmbedding());
239239
assertEquals(hotel.getId(), retrievedHotel.getId());
@@ -252,7 +252,7 @@ public void getBatchAsyncWithVectors(RecordCollectionOptions options) {
252252
List<String> ids = new ArrayList<>();
253253
hotels.forEach(hotel -> ids.add(hotel.getId()));
254254

255-
List<Hotel> retrievedHotels = recordCollection.getBatchAsync(ids, null).block();
255+
List<Hotel> retrievedHotels = recordCollection.getBatchAsync(ids, new GetRecordOptions(true)).block();
256256

257257
assertNotNull(retrievedHotels);
258258
assertEquals(hotels.size(), retrievedHotels.size());

api-test/integration-tests/src/test/java/com/microsoft/semantickernel/tests/connectors/memory/redis/RedisJsonVectorStoreRecordCollectionTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ private RedisJsonVectorStoreRecordCollection<Hotel> buildrecordCollection(@Nonnu
9898

9999
private List<Hotel> getHotels() {
100100
return List.of(
101-
new Hotel("id_1", "Hotel 1", 1, "Hotel 1 description", Arrays.asList(1.0f, 2.0f, 3.0f), 4.0),
102-
new Hotel("id_2", "Hotel 2", 2, "Hotel 2 description", Arrays.asList(1.0f, 2.0f, 3.0f), 3.0),
103-
new Hotel("id_3", "Hotel 3", 3, "Hotel 3 description", Arrays.asList(1.0f, 2.0f, 3.0f), 5.0),
104-
new Hotel("id_4", "Hotel 4", 4, "Hotel 4 description", Arrays.asList(1.0f, 2.0f, 3.0f), 4.0),
105-
new Hotel("id_5", "Hotel 5", 5, "Hotel 5 description", Arrays.asList(1.0f, 2.0f, 3.0f), 5.0)
101+
new Hotel("id_1", "Hotel 1", 1, "Hotel 1 description", Arrays.asList(1.0f, 2.0f, 3.0f), Arrays.asList(1.0f, 2.0f, 3.0f),4.0),
102+
new Hotel("id_2", "Hotel 2", 2, "Hotel 2 description", Arrays.asList(1.0f, 2.0f, 3.0f), Arrays.asList(1.0f, 2.0f, 3.0f),3.0),
103+
new Hotel("id_3", "Hotel 3", 3, "Hotel 3 description", Arrays.asList(1.0f, 2.0f, 3.0f), Arrays.asList(1.0f, 2.0f, 3.0f),5.0),
104+
new Hotel("id_4", "Hotel 4", 4, "Hotel 4 description", Arrays.asList(1.0f, 2.0f, 3.0f), Arrays.asList(1.0f, 2.0f, 3.0f),4.0),
105+
new Hotel("id_5", "Hotel 5", 5, "Hotel 5 description", Arrays.asList(1.0f, 2.0f, 3.0f), Arrays.asList(1.0f, 2.0f, 3.0f),5.0)
106106
);
107107
}
108108

@@ -234,7 +234,7 @@ public void getAsyncWithVectors(RecordCollectionOptions options) {
234234
recordCollection.upsertBatchAsync(hotels, null).block();
235235

236236
for (Hotel hotel : hotels) {
237-
Hotel retrievedHotel = recordCollection.getAsync(hotel.getId(), null).block();
237+
Hotel retrievedHotel = recordCollection.getAsync(hotel.getId(), new GetRecordOptions(true)).block();
238238
assertNotNull(retrievedHotel);
239239
assertNotNull(retrievedHotel.getDescriptionEmbedding());
240240
assertEquals(hotel.getId(), retrievedHotel.getId());
@@ -253,7 +253,7 @@ public void getBatchAsyncWithVectors(RecordCollectionOptions options) {
253253
List<String> ids = new ArrayList<>();
254254
hotels.forEach(hotel -> ids.add(hotel.getId()));
255255

256-
List<Hotel> retrievedHotels = recordCollection.getBatchAsync(ids, null).block();
256+
List<Hotel> retrievedHotels = recordCollection.getBatchAsync(ids, new GetRecordOptions(true)).block();
257257

258258
assertNotNull(retrievedHotels);
259259
assertEquals(hotels.size(), retrievedHotels.size());

semantickernel-experimental/src/main/java/com/microsoft/semantickernel/connectors/data/azureaisearch/AzureAISearchVectorStoreRecordCollection.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import com.azure.search.documents.models.VectorizableTextQuery;
1616
import com.azure.search.documents.models.VectorizedQuery;
1717
import com.microsoft.semantickernel.data.vectorsearch.VectorizableSearch;
18-
import com.microsoft.semantickernel.data.vectorsearch.VectorSearch;
1918
import com.microsoft.semantickernel.data.vectorsearch.VectorSearchResult;
2019
import com.microsoft.semantickernel.data.vectorsearch.VectorizedSearch;
2120
import com.microsoft.semantickernel.data.vectorstorage.VectorStoreRecordCollection;
@@ -120,7 +119,7 @@ public AzureAISearchVectorStoreRecordCollection(
120119
.map(VectorStoreRecordDataField::getEffectiveStorageName)
121120
.collect(Collectors.toList()));
122121

123-
storageNames = recordDefinition.getStorageNames();
122+
storageNames = recordDefinition.getFieldStorageNames();
124123
firstVectorFieldName = recordDefinition.getVectorFields().isEmpty() ? null
125124
: recordDefinition.getVectorFields().get(0).getName();
126125
}
@@ -194,7 +193,7 @@ public Mono<Record> getAsync(
194193
@Nonnull String key, GetRecordOptions options) {
195194
// If vectors are not requested, only fetch non-vector fields
196195
List<String> selectedFields = null;
197-
if (options != null && !options.includeVectors()) {
196+
if (options == null || !options.isIncludeVectors()) {
198197
selectedFields = Collections.unmodifiableList(nonVectorFields);
199198
}
200199

@@ -204,7 +203,7 @@ public Mono<Record> getAsync(
204203
// Use custom mapper if available
205204
if (mapper != null && mapper.getStorageModelToRecordMapper() != null) {
206205
return searchAsyncClient.getDocument(key, SearchDocument.class)
207-
.map(this.options.getVectorStoreRecordMapper()::mapStorageModeltoRecord);
206+
.map(record -> mapper.mapStorageModelToRecord(record, options));
208207
}
209208

210209
return searchAsyncClient
@@ -281,7 +280,8 @@ public Mono<Void> deleteBatchAsync(List<String> keys, DeleteRecordOptions option
281280
}).collect(Collectors.toList())).then();
282281
}
283282

284-
private Mono<List<VectorSearchResult<Record>>> searchAndMapAsync(SearchOptions searchOptions) {
283+
private Mono<List<VectorSearchResult<Record>>> searchAndMapAsync(SearchOptions searchOptions,
284+
GetRecordOptions getRecordOptions) {
285285
VectorStoreRecordMapper<Record, SearchDocument> mapper = this.options
286286
.getVectorStoreRecordMapper();
287287

@@ -292,7 +292,8 @@ private Mono<List<VectorSearchResult<Record>>> searchAndMapAsync(SearchOptions s
292292
// Use custom mapper if available
293293
if (mapper != null && mapper.getStorageModelToRecordMapper() != null) {
294294
record = mapper
295-
.mapStorageModeltoRecord(response.getDocument(SearchDocument.class));
295+
.mapStorageModelToRecord(response.getDocument(SearchDocument.class),
296+
getRecordOptions);
296297
} else {
297298
record = response.getDocument(this.options.getRecordClass());
298299
}
@@ -313,7 +314,7 @@ public Mono<List<VectorSearchResult<Record>>> searchAsync(VectorSearchQuery quer
313314
throw new SKException("No vector fields defined. Cannot perform vector search");
314315
}
315316

316-
VectorSearchOptions options = (VectorSearchOptions) query.getSearchOptions();
317+
VectorSearchOptions options = query.getSearchOptions();
317318
if (options == null) {
318319
options = VectorSearchOptions.createDefault(firstVectorFieldName);
319320
}
@@ -354,7 +355,7 @@ public Mono<List<VectorSearchResult<Record>>> searchAsync(VectorSearchQuery quer
354355
searchOptions.setSelect(nonVectorFields.toArray(new String[0]));
355356
}
356357

357-
return searchAndMapAsync(searchOptions);
358+
return searchAndMapAsync(searchOptions, new GetRecordOptions(options.isIncludeVectors()));
358359
}
359360

360361
/**

semantickernel-experimental/src/main/java/com/microsoft/semantickernel/connectors/data/jdbc/JDBCVectorStore.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
public class JDBCVectorStore implements SQLVectorStore {
2020
private final DataSource dataSource;
2121
private final JDBCVectorStoreOptions options;
22-
private final JDBCVectorStoreQueryProvider queryProvider;
22+
private final SQLVectorStoreQueryProvider queryProvider;
2323

2424
/**
2525
* Creates a new instance of the {@link JDBCVectorStore}.
@@ -37,7 +37,7 @@ public JDBCVectorStore(@Nonnull DataSource dataSource,
3737
if (this.options != null && this.options.getQueryProvider() != null) {
3838
this.queryProvider = this.options.getQueryProvider();
3939
} else {
40-
this.queryProvider = JDBCVectorStoreDefaultQueryProvider.builder()
40+
this.queryProvider = JDBCVectorStoreQueryProvider.builder()
4141
.withDataSource(dataSource)
4242
.build();
4343
}

0 commit comments

Comments
 (0)