{"record":{"id":"53fbf9da25aee215","repo":"spring-projects/spring-ai","slug":"field-type-0-not-supported","errorCode":null,"errorMessage":"Field type {0} not supported","messagePattern":"Field type (.+?) not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"vector-stores/spring-ai-redis-store/src/main/java/org/springframework/ai/vectorstore/redis/RedisFilterExpressionConverter.java","lineNumber":139,"sourceCode":"\t\t\t\tNumeric numeric = numeric(expression, value);\n\t\t\t\tcontext.append(\"[\");\n\t\t\t\tcontext.append(numeric.lower());\n\t\t\t\tcontext.append(\" \");\n\t\t\t\tcontext.append(numeric.upper());\n\t\t\t\tcontext.append(\"]\");\n\t\t\t\tbreak;\n\t\t\tcase TAG:\n\t\t\t\tcontext.append(\"{\");\n\t\t\t\tcontext.append(tagStringValue(expression, value));\n\t\t\t\tcontext.append(\"}\");\n\t\t\t\tbreak;\n\t\t\tcase TEXT:\n\t\t\t\tcontext.append(\"(\");\n\t\t\t\tcontext.append(textStringValue(expression, value));\n\t\t\t\tcontext.append(\")\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new UnsupportedOperationException(\n\t\t\t\t\t\tMessageFormat.format(\"Field type {0} not supported\", field.fieldType()));\n\t\t}\n\t}\n\n\tprivate String tagStringValue(Expression expression, Value value) {\n\t\tString delimiter = tagValueDelimiter(expression);\n\t\tif (value.value() instanceof List<?> list) {\n\t\t\treturn list.stream().map(String::valueOf).map(this::escapeTagValue).collect(Collectors.joining(delimiter));\n\t\t}\n\t\treturn escapeTagValue(String.valueOf(value.value()));\n\t}\n\n\tprivate String textStringValue(Expression expression, Value value) {\n\t\tString delimiter = tagValueDelimiter(expression);\n\t\tif (value.value() instanceof List<?> list) {\n\t\t\treturn list.stream()\n\t\t\t\t.map(String::valueOf)\n\t\t\t\t.map(RediSearchUtil::escapeQuery)","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/spring-projects/spring-ai/blob/98a7beda4f29d80a71c5837eb4053b03a93a46f7/vector-stores/spring-ai-redis-store/src/main/java/org/springframework/ai/vectorstore/redis/RedisFilterExpressionConverter.java#L121-L157","documentation":"doField renders a comparison for a metadata field according to its declared RediSearch field type (TAG, TEXT, NUMERIC). If the field's MetadataField.FieldType is not one of the handled types, the converter throws UnsupportedOperationException 'Field type {0} not supported'. Unknown or future field types cannot be translated into RediSearch query syntax.","triggerScenarios":"A filter expression on a metadata field whose configured FieldType falls into the default branch of the switch, e.g. a custom/unsupported field type added in a newer version or a wrongly typed MetadataField.","commonSituations":"Version drift where the converter doesn't handle a newly introduced field type; manually constructing metadata fields with an unexpected type.","solutions":["Change the field to a supported type: MetadataField.tag, .text, or .numeric","Check the spring-ai version's RedisFilterExpressionConverter for supported types and upgrade/downgrade accordingly","Use the matching filter operand style for the field's actual type (numeric comparisons for NUMERIC, string equality for TEXT)","Verify the MetadataField used at store-build time matches what the filter assumes"],"exampleFix":"// before\nMetadataField.builder(\"ts\").fieldType(CUSTOM).build();\n// after\nMetadataField.numeric(\"ts\");","handlingStrategy":"validation","validationCode":"Set<MetadataField.FieldType> supported = Set.of(TAG, TEXT, NUMERIC); if (!supported.contains(field.fieldType())) throw new UnsupportedOperationException(\"Field type not supported: \" + field.fieldType());","typeGuard":"static boolean isSupportedFieldType(MetadataField f) { return EnumSet.of(FieldType.TAG, FieldType.TEXT, FieldType.NUMERIC).contains(f.fieldType()); }","tryCatchPattern":"try { vectorStore.similaritySearch(request); } catch (UnsupportedOperationException e) { if (e.getMessage().contains(\"Field type\")) { /* reconfigure field type */ } else throw e; }","preventionTips":["Declare fields only as tag, text, or numeric","Match filter operand style to the declared field type","Pin and review library versions for newly introduced field types"],"tags":["redis","filter-expression","field-type","vector-store","spring-ai"],"backgroundTag":"unsupported-operation","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"}