weaviate/weaviate · error

unrecognized type: %T target: %v

Error message

unrecognized type: %T target: %v

What it means

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.

Source

Thrown at usecases/traverser/near_params_vector.go:295

			return nil, "", enterrors.NewErrSourceObjectNoVector(fmt.Errorf("vector not found for target: %v", targetVector))
		}
		vec, ok := res.Vectors[targetVector].([]float32)
		if !ok {
			return nil, "", fmt.Errorf("unrecognized type: %T for target: %v", res.Vectors[targetVector], targetVector)
		}
		return vec, targetVector, nil
	} else {
		if len(res.Vector) > 0 {
			return res.Vector, "", nil
		}

		if len(res.Vectors) == 1 {
			for key, vec := range res.Vectors {
				switch v := vec.(type) {
				case []float32:
					return v, key, nil
				default:
					return nil, "", fmt.Errorf("unrecognized type: %T target: %v", vec, key)
				}
			}
		} else if len(res.Vectors) > 1 {
			return nil, "", enterrors.NewErrSourceObjectNoVector(errors.New("multiple vectors found, specify target vector"))
		}
	}

	return nil, "", enterrors.NewErrSourceObjectNoVector(fmt.Errorf("nearObject search-object with id %v has no vector", id))
}

// TODO:colbert try to unify
// Failures carry the same typed errors as classFindVector.
func (v *nearParamsVector) classFindMultiVector(ctx context.Context, className string,
	id strfmt.UUID, tenant, targetVector string,
) ([][]float32, string, error) {
	res, err := v.search.Object(ctx, className, id, search.SelectProperties{}, additional.Properties{}, nil, tenant)
	if err != nil {
		return nil, "", err

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Explicitly pass targetVector naming a single-vector named vector, or add one to the collection.
  2. Use a search type that supports multi-vectors if you intend to search with the ColBERT-style vector.
  3. Verify the stored vector's type by fetching the object with additional { vector }.
  4. Re-import the object if its vector data was stored in a wrong shape.

Example fix

// before: no targetVector, only multi-vector named vector exists
nearObject: { id: "uuid" }
// after: name a single-vector target explicitly
nearObject: { id: "uuid", targetVector: "text_default" }
Defensive patterns

Strategy: validation

Validate before calling

// resolve the target explicitly instead of relying on implicit single-vector pick
obj, err := client.Data().ObjectsGetter().WithID(id.String()).WithVector().Do(ctx)
// if the object only has a multi-vector named vector, pass its targetVector explicitly

Type guard

func singleNamedVector(vectors map[string]interface{}) (name string, vec []float32, ok bool) {
  if len(vectors) != 1 { return "", nil, false }
  for k, v := range vectors {
    vec, ok = v.([]float32)
    if !ok { return "", nil, false }
    return k, vec, true
  }
  return
}

Try / catch

vec, _, err := findVector(ctx, class, id, tenant, "")
if err != nil && strings.Contains(err.Error(), "unrecognized type") {
  return fmt.Errorf("implicit vector resolution failed for %s; specify targetVector", id)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04). Data as JSON: /api/errors/cecaa225cb28789b. Report an issue: GitHub.