Skip to content
Closed
Show file tree
Hide file tree
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 @@ -75,6 +75,9 @@ private static Value value(Object value) {
return ValueFactory.value((String) value);
case "Integer":
return ValueFactory.value((Integer) value);
case "Long":
// use String representation
return ValueFactory.value(String.valueOf(value));
case "Double":
return ValueFactory.value((Double) value);
case "Float":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,27 @@ void getNativeClientTest() {
});
}

@Test
void shouldConvertLongToString() {
this.contextRunner.run(context -> {
QdrantVectorStore vectorStore = context.getBean(QdrantVectorStore.class);
var refId = System.currentTimeMillis();
var doc = new Document("Long type ref_id", Map.of("ref_id", refId));
vectorStore.add(List.of(doc));

List<Document> results = vectorStore
.similaritySearch(SearchRequest.builder().query("Long type ref_id").topK(1).build());
assertThat(results).hasSize(1);
Document resultDoc = results.get(0);
var resultRefId = resultDoc.getMetadata().get("ref_id");
assertThat(resultRefId).isInstanceOf(String.class);
assertThat(Double.valueOf((String) resultRefId)).isEqualTo(refId);

// Remove all documents from the store
vectorStore.delete(List.of(resultDoc.getId()));
});
}

@SpringBootConfiguration
public static class TestApplication {

Expand Down