{"record":{"id":"2579049cb24f82f5","repo":"weaviate/weaviate","slug":"vectorize-move-away-from-v","errorCode":null,"errorMessage":"vectorize move away from: %v","messagePattern":"vectorize move away from: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"usecases/modulecomponents/arguments/nearText/searcher.go","lineNumber":86,"sourceCode":"\t\tmoveToVector, err := s.vectorFromValuesAndObjects(ctx, moveTo.Values,\n\t\t\tmoveTo.Objects, className, findVectorFn, cfg, tenant)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Errorf(\"vectorize move to: %v\", err)\n\t\t}\n\n\t\tafterMoveTo, err := s.movements.MoveTo(vector, moveToVector, moveTo.Force)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvector = afterMoveTo\n\t}\n\n\tmoveAway := params.MoveAwayFrom\n\tif moveAway.Force > 0 && (len(moveAway.Values) > 0 || len(moveAway.Objects) > 0) {\n\t\tmoveAwayVector, err := s.vectorFromValuesAndObjects(ctx, moveAway.Values,\n\t\t\tmoveAway.Objects, className, findVectorFn, cfg, tenant)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Errorf(\"vectorize move away from: %v\", err)\n\t\t}\n\n\t\tafterMoveFrom, err := s.movements.MoveAwayFrom(vector, moveAwayVector, moveAway.Force)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvector = afterMoveFrom\n\t}\n\n\treturn vector, nil\n}\n\nfunc (s *vectorForParams[T]) vectorFromValuesAndObjects(ctx context.Context,\n\tvalues []string, objects []ObjectMove,\n\tclassName string,\n\tfindVectorFn modulecapabilities.FindVectorFn[T],\n\tcfg moduletools.ClassConfig, tenant string,\n) (T, error) {","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/usecases/modulecomponents/arguments/nearText/searcher.go#L68-L104","documentation":"This error wraps a failure that occurred while computing the vector for the `moveAwayFrom` clause of a nearText search in Weaviate. When a GraphQL/REST query includes `moveAwayFrom` with force > 0 and at least one value or object, the nearText module vectorizes the moved-away concepts (text values via the module's vectorizer, or object UUIDs by fetching their stored vectors). If any of that fails — vectorizer API error, unparseable beacon, or object not found — the underlying error is wrapped with \"vectorize move away from: %v\" and the whole query fails.","triggerScenarios":"A nearText search with `{concepts: [...], moveAwayFrom: {force: >0, concepts: [...] or objects: [{id/beacon}]}}` where (a) the vectorizer call for moveAwayFrom.concepts fails (e.g. text2vec API key invalid, network down), (b) a beacon in moveAwayFrom.objects is malformed, or (c) the referenced object does not exist / has no vector (findVectorFn error).","commonSituations":"Users pass an invalid or expired module API key (OpenAI/Cohere/etc.) so only the moveAwayFrom sub-vectorization fails; they typo a beacon like `weaviate://localhost/uuid` or use a UUID of a deleted object; or they mix concepts that the configured vectorizer cannot embed (e.g. empty strings).","solutions":["Check the wrapped inner error in the message — it names the real cause (vectorizer auth/network error, bad beacon, or object-not-found).","Verify the module's API key/env config (e.g. ENABLE_MODULES, X-OpenAI-Api-Key header) by running a plain nearText query without moveAwayFrom; if that also fails, it is a vectorizer configuration problem.","Validate each beacon/UUID in moveAwayFrom.objects exists and the object has been vectorized (GET the object by id before searching).","If moving away from an existing object, prefer `moveAwayFrom.objects` with the correct beacon format `weaviate://<host>/<collection>/<uuid>`; if moving away from text, ensure concepts are non-empty strings the vectorizer supports."],"exampleFix":"// before\n{\n  \"concepts\": [\"holiday\"],\n  \"moveAwayFrom\": {\"force\": 0.5, \"objects\": [{\"beacon\": \"weaviate://localhost/bad-uuid\"}]}\n}\n// after (existing, correctly formatted beacon)\n{\n  \"concepts\": [\"holiday\"],\n  \"moveAwayFrom\": {\"force\": 0.5, \"objects\": [{\"beacon\": \"weaviate://localhost/Article/77e5a4b0-...\"}]}\n}","handlingStrategy":"validation","validationCode":"// before sending a nearText query with moveAwayFrom\nif mt.MoveAwayFrom != nil && mt.MoveAwayFrom.Force > 0 {\n  if len(mt.MoveAwayFrom.Concepts) == 0 && len(mt.MoveAwayFrom.Objects) == 0 {\n    return fmt.Errorf(\"moveAwayFrom: provide concepts or objects when force > 0\")\n  }\n  for _, c := range mt.MoveAwayFrom.Concepts {\n    if strings.TrimSpace(c) == \"\" {\n      return fmt.Errorf(\"moveAwayFrom: empty concept\")\n    }\n  }\n  for _, o := range mt.MoveAwayFrom.Objects {\n    // beacon must parse and object must exist with a vector\n    if !isValidBeacon(o.Beacon) || !objectExistsAndVectorized(ctx, client, o.Beacon) {\n      return fmt.Errorf(\"moveAwayFrom: object %q missing or not vectorized\", o.Beacon)\n    }\n  }\n}","typeGuard":"func hasMoveAwayInput(m *MoveAwayFrom) bool {\n  return m != nil && m.Force > 0 && (len(m.Concepts) > 0 || len(m.Objects) > 0)\n}","tryCatchPattern":"result, err := client.GraphQL().Get().WithNearText(nearText).Do(ctx)\nif err != nil {\n  var apiErr *fault.WeaviateClientError\n  if errors.As(err, &apiErr) && strings.Contains(apiErr.Msg, \"vectorize move away from\") {\n    // fall back to query without moveAwayFrom, or surface the inner cause\n    return nil, fmt.Errorf(\"moveAwayFrom rejected: %w\", err)\n  }\n  return nil, err\n}","preventionTips":["Always test the plain nearText query (no move clauses) first to isolate vectorizer health.","Resolve object beacons from actual stored UUIDs, never hand-typed.","Keep the module API key configured server-side so per-request headers are optional.","Set force > 0 only together with at least one concept or object."],"tags":["go","weaviate","vectorization","neartext","graphql"],"backgroundTag":"vectorization-failed","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}