Files
spring-ai/vector-stores
Solomon Hsu 963b9dbded 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.

Signed-off-by: Solomon Hsu <solnone@gmail.com>
(cherry picked from commit f0d4cbf037)
2025-06-06 10:18:06 +00:00
..
2025-05-22 07:36:29 +01:00