{"record":{"id":"6f253f1c2516688e","repo":"weaviate/weaviate","slug":"cannot-convert-t-to-float64","errorCode":null,"errorMessage":"cannot convert %T to float64","messagePattern":"cannot convert %T to float64","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"usecases/traverser/boost_scorer.go","lineNumber":663,"sourceCode":"\t\treturn float64(d), nil\n\t}\n\treturn strconv.ParseFloat(s, 64)\n}\n\nfunc toFloat64(val any) (float64, error) {\n\tswitch v := val.(type) {\n\tcase float64:\n\t\treturn v, nil\n\tcase float32:\n\t\treturn float64(v), nil\n\tcase int:\n\t\treturn float64(v), nil\n\tcase int64:\n\t\treturn float64(v), nil\n\tcase string:\n\t\treturn strconv.ParseFloat(v, 64)\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"cannot convert %T to float64\", val)\n\t}\n}\n","sourceCodeStart":645,"sourceCodeEnd":666,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/usecases/traverser/boost_scorer.go#L645-L666","documentation":"toFloat64 converts a property value to float64 for numeric decay scoring, accepting float64, float32, int, int64, and numeric strings. This error is returned when the value at the decay path is of any other type (bool, time.Time directly, arrays, objects). The caller treats errors as score 0, so objects silently lose their decay boost rather than failing the query.","triggerScenarios":"A decay boost path pointing at a boolean, date (time.Time value not matched earlier because tryParseDate handles strings — time.Time IS handled, so this fires for e.g. bool, []float64, geo coordinates, or object/nested values), or any non-numeric property type.","commonSituations":"Decay path misconfigured to a boolean flag or cross-reference property; schema changed the property type after the query was written; sending an array of numbers as the decay path value.","solutions":["Point the decay path at a scalar numeric (int/float) or numeric-string property","Fix the property type in the schema if it should be numeric","Remove the decay boost or choose a different path"],"exampleFix":"// before\n{path: \"isActive\", origin: 1, scale: 10}  // bool property\n// after\n{path: \"activeCount\", origin: 0, scale: 10}","handlingStrategy":"type-guard","validationCode":"// ensure the decay path resolves to a scalar numeric property in the schema\nschema, _ := client.Schema().Getter().WithClassName(\"Article\").Do(ctx)\nfor _, p := range schema.Properties {\n  if p.Name == \"viewCount\" {\n    switch p.DataType[0] {\n    case \"int\", \"number\": // ok\n    default: log.Printf(\"decay path %s is not numeric\", p.Name)\n    }\n  }\n}","typeGuard":"func isNumericForDecay(v any) bool {\n  switch v.(type) {\n  case float64, float32, int, int64, string:\n    return true\n  }\n  return false\n}","tryCatchPattern":null,"preventionTips":["Point decay paths only at int/number/number[] scalar properties","Re-check decay configs after schema type migrations","Remember failures here are silent (score 0) — log client-side when boosts seem ineffective"],"tags":["go","graphql","decay-boost","type-mismatch"],"backgroundTag":"unsupported-property-type","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"}