{"record":{"id":"72e3c2c9aa6c86b2","repo":"spring-projects/spring-ai","slug":"not-supported-expression-type-expressiontype-72e3c2","errorCode":null,"errorMessage":"Not supported expression type: {expressionType}","messagePattern":"Not supported expression type: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"vector-stores/spring-ai-gemfire-store/src/main/java/org/springframework/ai/vectorstore/gemfire/GemFireAiSearchFilterExpressionConverter.java","lineNumber":99,"sourceCode":"\t}\n\n\t@Override\n\tprotected void doAddValueRangeSpitter(Filter.Value listValue, StringBuilder context) {\n\t\tcontext.append(\" OR \");\n\t}\n\n\tprivate String getOperationSymbol(Expression exp) {\n\t\treturn switch (exp.type()) {\n\t\t\tcase AND -> \" AND \";\n\t\t\tcase OR -> \" OR \";\n\t\t\tcase EQ, IN -> \"\";\n\t\t\tcase NE -> \" NOT \";\n\t\t\tcase LT -> \"}\";\n\t\t\tcase LTE -> \"]\";\n\t\t\tcase GT -> \"{\";\n\t\t\tcase GTE -> \"[\";\n\t\t\tcase NIN -> \"NOT \";\n\t\t\tdefault -> throw new RuntimeException(\"Not supported expression type: \" + exp.type());\n\t\t};\n\t}\n\n\t@Override\n\tpublic void doKey(Key key, StringBuilder context) {\n\t\tvar identifier = key.key();\n\t\temitLuceneString(identifier.trim(), context);\n\t\tcontext.append(\":\");\n\t}\n\n\t@Override\n\tprotected void doValue(Filter.Value filterValue, StringBuilder context) {\n\t\tif (filterValue.value() instanceof List list) {\n\t\t\tint c = 0;\n\t\t\tfor (Object v : list) {\n\t\t\t\tthis.doSingleValue(normalizeDateString(v), context);\n\t\t\t\tif (c++ < list.size() - 1) {\n\t\t\t\t\tthis.doAddValueRangeSpitter(filterValue, context);","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/spring-projects/spring-ai/blob/98a7beda4f29d80a71c5837eb4053b03a93a46f7/vector-stores/spring-ai-gemfire-store/src/main/java/org/springframework/ai/vectorstore/gemfire/GemFireAiSearchFilterExpressionConverter.java#L81-L117","documentation":"GemFireAiSearchFilterExpressionConverter.getOperationSymbol throws RuntimeException when a Filter.Expression type has no GemFire mapping. Supported types are IN, EQ, NE, LT, LTE, GT, GTE, NIN; any other expression type hits the default branch during filter-to-GemFire-OQL conversion.","triggerScenarios":"Calling similaritySearch or delete with a Filter.Expression containing a type outside the supported set (e.g. a custom or newer Filter API expression type) which doExpression routes into getOperationSymbol.","commonSituations":"Custom predicate types, version mismatch between the Spring AI Filter API and the GemFire store's converter, or hand-built expressions using unsupported semantics.","solutions":["Use only supported expression types: IN, EQ, NE, LT, LTE, GT, GTE, NIN with AND/OR grouping","Keep spring-ai-gemfire-store and the Spring AI core versions in sync","Subclass the converter and override getOperationSymbol if custom types must be supported"],"exampleFix":"// before: unsupported type\nnew Filter.Expression(ExpressionType.CONTAINS, key, value);\n// after: emulate with supported operators\nnew Filter.Expression(ExpressionType.EQ, key, value);","handlingStrategy":"validation","validationCode":"private static final Set<ExpressionType> SUPPORTED = Set.of(IN, EQ, NE, LT, LTE, GT, GTE, NIN);\nif (!SUPPORTED.contains(expression.type())) throw new IllegalArgumentException(\"GemFire converter does not support: \" + expression.type());","typeGuard":null,"tryCatchPattern":"try {\n    vectorStore.similaritySearch(req.withFilterExpression(expr));\n} catch (RuntimeException e) {\n    if (e.getMessage().startsWith(\"Not supported expression type\")) {\n        throw new IllegalArgumentException(\"Restrict filter to GemFire-supported operators\", e);\n    }\n    throw e;\n}","preventionTips":["Stick to the documented supported Filter.Expression types","Pin Spring AI core/store versions together in the build","Cover converter doExpression paths with unit tests"],"tags":["gemfire","filter-expression","vector-store","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"98a7beda4f29d80a71c5837eb4053b03a93a46f7","analyzedAt":"2026-09-11T14:15:49.441Z","contentChangedAt":"2026-09-11T14:15:49.441Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}