{"record":{"id":"10742c370bdac6a5","repo":"weaviate/weaviate","slug":"indexrangefilters-is-allowed-only-for-number-int","errorCode":null,"errorMessage":"`indexRangeFilters` is allowed only for number/int/date data types. For other data types set false or leave empty","messagePattern":"`indexRangeFilters` is allowed only for number/int/date data types\\. For other data types set false or leave empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"usecases/schema/class.go","lineNumber":1319,"sourceCode":"\t\tcase schema.DataTypeText, schema.DataTypeTextArray:\n\t\t\t// true or false allowed\n\t\tdefault:\n\t\t\tif *prop.IndexSearchable {\n\t\t\t\treturn fmt.Errorf(\"`indexSearchable` is allowed only for text/text[] data types. \" +\n\t\t\t\t\t\"For other data types set false or leave empty\")\n\t\t\t}\n\t\t}\n\t}\n\tif prop.IndexRangeFilters != nil {\n\t\tswitch dataType {\n\t\tcase schema.DataTypeNumber, schema.DataTypeInt, schema.DataTypeDate:\n\t\t\t// true or false allowed\n\t\tcase schema.DataTypeNumberArray, schema.DataTypeIntArray, schema.DataTypeDateArray:\n\t\t\t// not supported (yet?)\n\t\t\tfallthrough\n\t\tdefault:\n\t\t\tif *prop.IndexRangeFilters {\n\t\t\t\treturn fmt.Errorf(\"`indexRangeFilters` is allowed only for number/int/date data types. \" +\n\t\t\t\t\t\"For other data types set false or leave empty\")\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc validatePropertyProcessing(prop *models.Property, propertyDataType schema.PropertyDataType, userPresets map[string][]string) error {\n\t// Treat an empty config as absent — some client generators emit\n\t// \"textAnalyzer\": {} by default and this should not block creation.\n\tif prop.TextAnalyzer != nil && !prop.TextAnalyzer.ASCIIFold && len(prop.TextAnalyzer.ASCIIFoldIgnore) == 0 && prop.TextAnalyzer.StopwordPreset == \"\" {\n\t\tprop.TextAnalyzer = nil\n\t}\n\tif prop.TextAnalyzer == nil {\n\t\treturn nil\n\t}\n","sourceCodeStart":1301,"sourceCodeEnd":1337,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/usecases/schema/class.go#L1301-L1337","documentation":"`indexRangeFilters` enables range-comparison (>, <=, between) filter structures, which Weaviate currently builds only for numeric and date types (number, int, date). Setting the flag to true on any other (or array variant not yet supported) dataType is rejected by validatePropertyIndexing. Note the source: even number[]/int[]/date[] fall through to default, so arrays are rejected too ('not supported (yet?)').","triggerScenarios":"Create/update property with dataType text, boolean, phoneNumber, or number[]/int[]/date[] and `indexRangeFilters: true`.","commonSituations":"Assuming array numerics support range filters like scalars; enabling the flag on every property for consistency; expecting range filters on strings/dates-as-strings.","solutions":["Only set `indexRangeFilters: true` on scalar `number`, `int`, or `date` properties; remove it elsewhere.","For array numerics, either drop range filtering or restructure into individual scalar properties.","Use `indexFilterable` for equality filtering on non-range types."],"exampleFix":"// before\n{\"name\":\"scores\",\"dataType\":[\"int[]\"],\"indexRangeFilters\":true}\n// after\n{\"name\":\"scores\",\"dataType\":[\"int[]\"],\"indexFilterable\":true}","handlingStrategy":"validation","validationCode":"function validateRangeFilters(prop) {\n  const allowed = ['number','int','date']; // array variants not supported\n  if (prop.indexRangeFilters === true && !allowed.includes(prop.dataType[0])) {\n    throw new Error(`property '${prop.name}': indexRangeFilters only for scalar number/int/date`);\n  }\n}","typeGuard":"function supportsRangeFilters(prop) {\n  return ['number','int','date'].includes(prop.dataType[0]);\n}","tryCatchPattern":null,"preventionTips":["Remember range filters are scalar-only: number/int/date, NOT their [] variants.","Gate the flag behind a helper that knows the supported type list."],"tags":["schema","validation","indexing","range-filters"],"backgroundTag":"index-range-filters-invalid-datatype","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}