You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(qdrant): support Long type in payload by converting to String
Qdrant does not support java.lang.Long as a native payload type.
Previously, passing a Long value caused the following exception:
java.lang.IllegalArgumentException: Unsupported Qdrant value type: class java.lang.Long
at org.springframework.ai.vectorstore.qdrant.QdrantValueFactory.value(QdrantValueFactory.java:85)
at org.springframework.ai.vectorstore.qdrant.QdrantValueFactory.lambda$toValueMap$1(QdrantValueFactory.java:46)
...
To resolve this, Long values are now converted to their String representation
in QdrantValueFactory. This preserves precision and avoids serialization issues.
test(qdrant): add test to verify Long metadata values are stored as String
Adds a test to ensure that Long values in document metadata are
safely converted to String before being stored in Qdrant.
The test inserts a document with a Long-type "ref_id", performs
a similarity search, and verifies that:
- the result is not empty,
- the retrieved "ref_id" is a String,
- the value matches the original Long when parsed.
Also ensures cleanup by deleting the inserted document from the store.
Auto-cherry-pick to 1.0.x
Signed-off-by: Solomon Hsu <solnone@gmail.com>
Copy file name to clipboardExpand all lines: vector-stores/spring-ai-qdrant-store/src/main/java/org/springframework/ai/vectorstore/qdrant/QdrantValueFactory.java
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,9 @@ private static Value value(Object value) {
Copy file name to clipboardExpand all lines: vector-stores/spring-ai-qdrant-store/src/test/java/org/springframework/ai/vectorstore/qdrant/QdrantVectorStoreIT.java
0 commit comments