{"record":{"id":"4f6c83895654514d","repo":"spring-projects/spring-ai","slug":"unsupported-value-type-for-gte-condition-only-sup","errorCode":null,"errorMessage":"Unsupported value type for GTE condition. Only supports Number","messagePattern":"Unsupported value type for GTE condition\\. Only supports Number","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"vector-stores/spring-ai-qdrant-store/src/main/java/org/springframework/ai/vectorstore/qdrant/QdrantFilterExpressionConverter.java","lineNumber":149,"sourceCode":"\t}\n\n\tprotected Condition buildLtCondition(Key key, Value value) {\n\t\tString identifier = doKey(key);\n\t\tif (value.value() instanceof Number valueNum) {\n\t\t\tDouble dvalue = Double.parseDouble(valueNum.toString());\n\t\t\treturn io.qdrant.client.ConditionFactory.range(identifier, Range.newBuilder().setLt(dvalue).build());\n\t\t}\n\t\tthrow new RuntimeException(\"Unsupported value type for LT condition. Only supports Number\");\n\n\t}\n\n\tprotected Condition buildGteCondition(Key key, Value value) {\n\t\tString identifier = doKey(key);\n\t\tif (value.value() instanceof Number valueNum) {\n\t\t\tDouble dvalue = Double.parseDouble(valueNum.toString());\n\t\t\treturn io.qdrant.client.ConditionFactory.range(identifier, Range.newBuilder().setGte(dvalue).build());\n\t\t}\n\t\tthrow new RuntimeException(\"Unsupported value type for GTE condition. Only supports Number\");\n\n\t}\n\n\tprotected Condition buildLteCondition(Key key, Value value) {\n\t\tString identifier = doKey(key);\n\t\tif (value.value() instanceof Number valueNum) {\n\t\t\tDouble dvalue = Double.parseDouble(valueNum.toString());\n\t\t\treturn io.qdrant.client.ConditionFactory.range(identifier, Range.newBuilder().setLte(dvalue).build());\n\t\t}\n\t\tthrow new RuntimeException(\"Unsupported value type for LTE condition. Only supports Number\");\n\n\t}\n\n\tprotected Condition buildInCondition(Key key, Value value) {\n\t\tif (value.value() instanceof List valueList && !valueList.isEmpty()) {\n\t\t\tObject firstValue = valueList.get(0);\n\t\t\tString identifier = doKey(key);\n","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/spring-projects/spring-ai/blob/98a7beda4f29d80a71c5837eb4053b03a93a46f7/vector-stores/spring-ai-qdrant-store/src/main/java/org/springframework/ai/vectorstore/qdrant/QdrantFilterExpressionConverter.java#L131-L167","documentation":"Filter translation guard in QdrantFilterExpressionConverter.buildGteCondition: a GTE (greater-than-or-equal) comparison was given a non-Number right-hand value; only numeric range comparisons are supported.","triggerScenarios":"Filter.builder().gte(\"rating\", \"4\").build() or gte(\"year\", true) — GTE with a String, Boolean, date, or null right operand.","commonSituations":"Same family as GT/LT: dates as ISO strings, numbers arriving as strings from web request parameters.","solutions":["Use a numeric value for the GTE comparison"],"exampleFix":"// before\nFilter.builder().gte(\"createdAt\", \"2024-01-01\").build();\n// after\nFilter.builder().gte(\"createdAt\", 1704067200L).build();","handlingStrategy":"validation","validationCode":"static void checkGteOperand(Object v) {\n    if (!(v instanceof Number)) {\n        throw new IllegalArgumentException(\"GTE operand must be a Number, got \" + (v == null ? \"null\" : v.getClass()));\n    }\n}","typeGuard":"static boolean isNumber(Object v) {\n    return v instanceof Number;\n}","tryCatchPattern":"try {\n    vectorStore.similaritySearch(req);\n} catch (RuntimeException ex) {\n    if (ex.getMessage() != null && ex.getMessage().contains(\"GTE condition. Only supports Number\")) {\n        throw new IllegalArgumentException(\"GTE requires a numeric operand\", ex);\n    }\n    throw ex;\n}","preventionTips":["Use epoch numbers for date lower bounds.","Validate operand types before calling filterExpression().","Fix ingestion so the field is stored as a Qdrant numeric."],"tags":["qdrant","filter-expression","gte","range","spring-ai"],"backgroundTag":"type-mismatch","analyzedSha":"98a7beda4f29d80a71c5837eb4053b03a93a46f7","analyzedAt":"2026-09-11T14:15:49.441Z","contentChangedAt":"2026-09-11T14:15:49.441Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}