{"record":{"id":"5b14f44310dd1928","repo":"weaviate/weaviate","slug":"nearthermal-targetvectors-cannot-provide-more-than","errorCode":null,"errorMessage":"nearThermal.targetVectors cannot provide more than 1 target vector value","messagePattern":"nearThermal\\.targetVectors cannot provide more than 1 target vector value","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"usecases/modulecomponents/arguments/nearThermal/param.go","lineNumber":58,"sourceCode":"}\n\nfunc validateNearThermalFn(param interface{}) error {\n\tnearThermal, ok := param.(*NearThermalParams)\n\tif !ok {\n\t\treturn errors.New(\"'nearThermal' invalid parameter\")\n\t}\n\n\tif len(nearThermal.Thermal) == 0 {\n\t\treturn errors.New(\"'nearThermal.thermal' needs to be defined\")\n\t}\n\n\tif nearThermal.Certainty != 0 && nearThermal.WithDistance {\n\t\treturn errors.New(\n\t\t\t\"nearThermal cannot provide both distance and certainty\")\n\t}\n\n\tif len(nearThermal.TargetVectors) > 1 {\n\t\treturn errors.New(\n\t\t\t\"nearThermal.targetVectors cannot provide more than 1 target vector value\")\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":40,"sourceCodeEnd":64,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/usecases/modulecomponents/arguments/nearThermal/param.go#L40-L64","documentation":"The nearThermal argument's targetVectors list contains more than one vector name. Because nearThermal performs similarity search against a single media embedding, Weaviate restricts targetVectors to at most one entry when the query targets multi-vector collections. validateNearThermalFn enforces this limit.","triggerScenarios":"Sending nearThermal: {thermal: \"...\", targetVectors: [\"a\", \"b\"]} against a collection with multiple named vectors — the list has length > 1, which the validator rejects.","commonSituations":"Copy-pasting a nearText-style query where multiple target vectors may be handled differently; generic query builders that forward the whole configured targetVectors array without truncating; schema evolution adding a second named vector to an existing collection that already had a nearThermal query listing all vectors.","solutions":["Reduce targetVectors to a single vector name in the nearThermal argument","Pick the specific named vector the thermal module produces (e.g. the thermal embedding vector) rather than passing all collection vectors","If you need to search multiple vectors, issue one nearThermal query per target vector and combine results client-side","In dynamic query builders, assert len(targetVectors) <= 1 for nearThermal before serializing the request"],"exampleFix":"// before\nnearThermal: {thermal: \"...\", targetVectors: [\"thermal_vec\", \"rgb_vec\"]}\n\n// after\nnearThermal: {thermal: \"...\", targetVectors: [\"thermal_vec\"]}","handlingStrategy":"validation","validationCode":"if p, ok := arg.(*nearThermal.NearThermalParams); ok && p != nil && len(p.TargetVectors) > 1 {\n    return fmt.Errorf(\"nearThermal supports at most 1 target vector, got %d\", len(p.TargetVectors))\n}","typeGuard":null,"tryCatchPattern":"err := validateNearThermalFn(arg)\nif err != nil && strings.Contains(err.Error(), \"targetVectors\") {\n    // truncate to the first vector or fan out one query per vector\n}","preventionTips":["Always pass exactly one target vector for nearThermal queries","In multi-vector collections, name the specific vector the thermal module produced","Add a builder-level assert len(targetVectors) <= 1 for media near* arguments"],"tags":["graphql","validation","target-vectors","multi-vector","weaviate-module"],"backgroundTag":"invalid-target-vectors","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"}