{"record":{"id":"0d21db99e7ff8c54","repo":"weaviate/weaviate","slug":"cannot-use-whitespace-in-stopword-additions","errorCode":null,"errorMessage":"cannot use whitespace in stopword.additions","messagePattern":"cannot use whitespace in stopword\\.additions","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/inverted/config.go","lineNumber":159,"sourceCode":"\t\treturn errors.Errorf(\"stopwordPreset '%s' does not exist\", conf.Preset)\n\t}\n\n\terr := validateStopwordAdditionsRemovals(conf)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc validateStopwordAdditionsRemovals(conf *models.StopwordConfig) error {\n\t// the same stopword cannot exist\n\t// in both additions and removals\n\tfoundAdditions := make(map[string]int)\n\n\tfor idx, add := range conf.Additions {\n\t\tif strings.TrimSpace(add) == \"\" {\n\t\t\treturn errors.Errorf(\"cannot use whitespace in stopword.additions\")\n\t\t}\n\n\t\t// save the index of the addition since it\n\t\t// is readily available here. we will need\n\t\t// this below when trimming additions that\n\t\t// already exist in the selected preset\n\t\tfoundAdditions[add] = idx\n\t}\n\n\tfor _, rem := range conf.Removals {\n\t\tif strings.TrimSpace(rem) == \"\" {\n\t\t\treturn errors.Errorf(\"cannot use whitespace in stopword.removals\")\n\t\t}\n\n\t\tif _, ok := foundAdditions[rem]; ok {\n\t\t\treturn errors.Errorf(\n\t\t\t\t\"found '%s' in both stopwords.additions and stopwords.removals\", rem)\n\t\t}","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/inverted/config.go#L141-L177","documentation":"Stopword config validation found an entry in stopword.additions that is empty or whitespace-only. Blank stopwords cannot match tokens and would pollute the preset, so they are rejected during Additions scanning.","triggerScenarios":"Thrown at adapters/repos/db/inverted/config.go:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove or trim empty entries from stopword.additions","Note: additions already present in the chosen preset are trimmed automatically"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}