weaviate/weaviate · error

multiple multi vectors found, specify target vector

Error message

multiple multi vectors found, specify target vector

What it means

Thrown when the single object referenced by a nearObject search has more than one named vector and no targetVector was specified. With multiple vectors on one object the library cannot know which vector space to compute distances in, so it refuses to guess and asks the caller to disambiguate.

Source

Thrown at usecases/traverser/near_params_vector.go:438

	switch len(res) {
	case 0:
		return nil, "", errors.New("multi vector not found")
	case 1:
		if targetVector != "" {
			if len(res[0].Vectors) == 0 || res[0].Vectors[targetVector] == nil {
				return nil, "", fmt.Errorf("multi vector not found for target: %v", targetVector)
			}
		} else {
			if len(res[0].Vectors) == 1 {
				for key, vec := range res[0].Vectors {
					v, ok := vec.([][]float32)
					if !ok {
						return nil, "", fmt.Errorf("unrecognized multi vector type: %T", vec)
					}
					return v, key, nil
				}
			} else if len(res[0].Vectors) > 1 {
				return nil, "", errors.New("multiple multi vectors found, specify target vector")
			}
		}
		return nil, "", fmt.Errorf("multi vector not found for target: %v", targetVector)
	default:
		return nil, "", fmt.Errorf("multiple multi vectors with incompatible dimensions found for target: %s", targetVector)
	}
}

func (v *nearParamsVector) crossClassVectorFromNearObjectParams(ctx context.Context,
	params *searchparams.NearObject,
) (models.Vector, string, error) {
	return v.vectorFromNearObjectParams(ctx, "", params, "", "")
}

func (v *nearParamsVector) vectorFromNearObjectParams(ctx context.Context,
	className string, params *searchparams.NearObject, tenant, targetVector string,
) (models.Vector, string, error) {
	if len(params.ID) == 0 && len(params.Beacon) == 0 {

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Add targetVector: "<name>" to the nearObject/nearVector clause, naming one of the collection's configured named vectors.
  2. Check which named vectors exist on the class (schema) and use exactly one of those names.
  3. Update client queries/templates that predate the multi-vector migration.
  4. If a targetVector was passed, fix its spelling/casing to match the configured vector name.

Example fix

// before
{ Get { Product (nearObject: {id: "6ba7b810-..."}) { name } } }
// after
{ Get { Product (nearObject: {id: "6ba7b810-...", targetVector: "title_vector"}) { name } } }
Defensive patterns

Strategy: validation

Validate before calling

// before issuing a nearObject query on a named-vector class:
schema, _ := client.Schema().Getter().GetSchema(ctx)
cls := schema.GetClass(classKey)
numVectors := len(cls.VectorConfig) // >1 means targetVector is mandatory
if numVectors > 1 && nearObject.TargetVector == "" {
  return fmt.Errorf("class %s has %d named vectors; specify targetVector", cls.Class, numVectors)
}

Type guard

func targetVectorSet(p NearObjectParams, classHasNamedVectors bool) bool {
  return !classHasNamedVectors || (p != nil && p.TargetVector != "")
}

Try / catch

res, err := runGraphQLQuery(ctx, q)
var ep *weaviate.ErrInvalidInput
if errors.As(err, &ep) && strings.Contains(err.Error(), "multiple multi vectors found") {
  // add targetVector and retry
  q = addTargetVector(q, defaultTargetVector)
  res, err = runGraphQLQuery(ctx, q)
}

Prevention

When it happens

Trigger: A collection configured with multiple named vectors (multi-vector / named vectors feature) where the referenced object's res[0].Vectors map has len > 1, and the nearObject/nearVector query omits targetVector. Also the generic fallback at :438 when the target vector name given does not match any named vector on the object.

Common situations: Collections migrated to named vectors (e.g. adding a second vectorizer) while old client queries were written for single-vector schema; typo in the targetVector name so it resolves as empty/unmatched; GraphQL queries generated before the schema change.

Related errors


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