{"record":{"id":"cecaa225cb28789b","repo":"weaviate/weaviate","slug":"unrecognized-type-t-target-v","errorCode":null,"errorMessage":"unrecognized type: %T target: %v","messagePattern":"unrecognized type: %T target: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"usecases/traverser/near_params_vector.go","lineNumber":295,"sourceCode":"\t\t\treturn nil, \"\", enterrors.NewErrSourceObjectNoVector(fmt.Errorf(\"vector not found for target: %v\", targetVector))\n\t\t}\n\t\tvec, ok := res.Vectors[targetVector].([]float32)\n\t\tif !ok {\n\t\t\treturn nil, \"\", fmt.Errorf(\"unrecognized type: %T for target: %v\", res.Vectors[targetVector], targetVector)\n\t\t}\n\t\treturn vec, targetVector, nil\n\t} else {\n\t\tif len(res.Vector) > 0 {\n\t\t\treturn res.Vector, \"\", nil\n\t\t}\n\n\t\tif len(res.Vectors) == 1 {\n\t\t\tfor key, vec := range res.Vectors {\n\t\t\t\tswitch v := vec.(type) {\n\t\t\t\tcase []float32:\n\t\t\t\t\treturn v, key, nil\n\t\t\t\tdefault:\n\t\t\t\t\treturn nil, \"\", fmt.Errorf(\"unrecognized type: %T target: %v\", vec, key)\n\t\t\t\t}\n\t\t\t}\n\t\t} else if len(res.Vectors) > 1 {\n\t\t\treturn nil, \"\", enterrors.NewErrSourceObjectNoVector(errors.New(\"multiple vectors found, specify target vector\"))\n\t\t}\n\t}\n\n\treturn nil, \"\", enterrors.NewErrSourceObjectNoVector(fmt.Errorf(\"nearObject search-object with id %v has no vector\", id))\n}\n\n// TODO:colbert try to unify\n// Failures carry the same typed errors as classFindVector.\nfunc (v *nearParamsVector) classFindMultiVector(ctx context.Context, className string,\n\tid strfmt.UUID, tenant, targetVector string,\n) ([][]float32, string, error) {\n\tres, err := v.search.Object(ctx, className, id, search.SelectProperties{}, additional.Properties{}, nil, tenant)\n\tif err != nil {\n\t\treturn nil, \"\", err","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/usecases/traverser/near_params_vector.go#L277-L313","documentation":"When no targetVector is given, Weaviate looks at the legacy res.Vector first; if empty and exactly one named vector exists, it assumes that vector and asserts it is []float32. This error means the single stored named vector has an unexpected type (not a single []float32 vector), so it cannot serve as the implicit search anchor.","triggerScenarios":"A nearObject/nearText-by-id search with no targetVector on an object whose only named vector is a multi-vector ([][]float32, e.g. ColBERT); the object has no legacy Vector and exactly one entry in Vectors whose type is not []float32.","commonSituations":"Querying single-vector near* search against a collection that only has a ColBERT/multi-vector named vector; users unaware that implicit target resolution requires a single-vector type.","solutions":["Explicitly pass targetVector naming a single-vector named vector, or add one to the collection.","Use a search type that supports multi-vectors if you intend to search with the ColBERT-style vector.","Verify the stored vector's type by fetching the object with additional { vector }.","Re-import the object if its vector data was stored in a wrong shape."],"exampleFix":"// before: no targetVector, only multi-vector named vector exists\nnearObject: { id: \"uuid\" }\n// after: name a single-vector target explicitly\nnearObject: { id: \"uuid\", targetVector: \"text_default\" }","handlingStrategy":"validation","validationCode":"// resolve the target explicitly instead of relying on implicit single-vector pick\nobj, err := client.Data().ObjectsGetter().WithID(id.String()).WithVector().Do(ctx)\n// if the object only has a multi-vector named vector, pass its targetVector explicitly","typeGuard":"func singleNamedVector(vectors map[string]interface{}) (name string, vec []float32, ok bool) {\n  if len(vectors) != 1 { return \"\", nil, false }\n  for k, v := range vectors {\n    vec, ok = v.([]float32)\n    if !ok { return \"\", nil, false }\n    return k, vec, true\n  }\n  return\n}","tryCatchPattern":"vec, _, err := findVector(ctx, class, id, tenant, \"\")\nif err != nil && strings.Contains(err.Error(), \"unrecognized type\") {\n  return fmt.Errorf(\"implicit vector resolution failed for %s; specify targetVector\", id)\n}","preventionTips":["Always pass targetVector explicitly when a collection has any non-[]float32 named vectors.","Avoid creating collections whose only named vector is multi-vector if you also use nearObject anchoring.","Document per-collection which targets are single- vs multi-vector."],"tags":["weaviate","named-vectors","type-mismatch","multi-vector"],"backgroundTag":"vector-type-mismatch","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"}