{"record":{"id":"c9c7e3c2c124c71e","repo":"weaviate/weaviate","slug":"no-results-for-generative-search-despite-a-search-c9c7e3","errorCode":null,"errorMessage":"No results for generative search despite a search request. Is a generative module enabled?","messagePattern":"No results for generative search despite a search request\\. Is a generative module enabled\\?","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/handlers/grpc/v1/prepare_reply.go","lineNumber":459,"sourceCode":"\t\tName:            group.GroupedBy.Value,\n\t\tMaxDistance:     group.MaxDistance,\n\t\tMinDistance:     group.MinDistance,\n\t\tNumberOfObjects: int64(group.Count),\n\t}\n\n\tgroupedGenerativeResults := \"\"\n\tif generativeSearchEnabled {\n\t\tgenerateFmt, err := extractGenerateResult(addProps)\n\t\tif err != nil {\n\t\t\treturn nil, \"\", err\n\t\t}\n\n\t\tgenerativeSearch, ok := generativeSearchRaw.(*generate.Params)\n\t\tif !ok {\n\t\t\treturn nil, \"\", errors.New(\"could not cast generative search params\")\n\t\t}\n\t\tif generativeSearch.Prompt != nil && generateFmt.SingleResult == nil {\n\t\t\treturn nil, \"\", errors.New(\"No results for generative search despite a search request. Is a generative module enabled?\")\n\t\t}\n\n\t\tif generateFmt.Error != nil {\n\t\t\treturn nil, \"\", generateFmt.Error\n\t\t}\n\n\t\tif generateFmt.SingleResult != nil && *generateFmt.SingleResult != \"\" {\n\t\t\tret.Generative = &pb.GenerativeReply{Result: *generateFmt.SingleResult}\n\t\t}\n\n\t\t// grouped results are only added to the first object for GQL reasons\n\t\t// however, reranking can result in a different order, so we need to check every object\n\t\t// recording the result if it's present assuming that it is at least somewhere and will be caught\n\t\tif generateFmt.GroupedResult != nil && *generateFmt.GroupedResult != \"\" {\n\t\t\tgroupedGenerativeResults = *generateFmt.GroupedResult\n\t\t}\n\t}\n","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/handlers/grpc/v1/prepare_reply.go#L441-L477","documentation":"This error is thrown during a group-by search over gRPC when the request carried a generative prompt (generate.Params.Prompt != nil), but the resolved _additional 'generate' result contains no SingleResult. It means the search executed but no generative module produced output, almost always because no generative module (or the wrong one) is enabled on the collection/cluster.","triggerScenarios":"A gRPC (or GraphQL-translated) group-by search with a singleResult/prompt generative task set, where the reply extraction finds generativeSearch.Prompt set but generateFmt.SingleResult == nil — e.g. the 'generate' additional prop was missing or empty because no generative module was configured for the collection.","commonSituations":"Running weaviate without ENABLE_MODULES including a generative module (e.g. generative-openai); module enabled cluster-wide but not set in the collection's moduleConfig; querying a multi-tenancy collection whose template config was copied without the generative module; API keys not configured so the module silently returned nothing; upgrading schemas from a setup where generative was added later.","solutions":["Enable a generative module for the collection, e.g. moduleConfig: {\"generative-openai\": {\"model\": \"gpt-4\"}} in the collection schema, and include the module in ENABLE_MODULES at startup","Verify with GraphQL introspection or /v1/schema that the collection's moduleConfig contains a generative-* module","Check that required module env vars (e.g. OPENAI_APIKEY) are set so the module can actually produce results","Re-run the search and confirm the _additional.generate.singleResult field is populated"],"exampleFix":"// before — collection created without a generative module\nclient.collections.create({ name: 'Article' })\n\n// after — enable a generative module on the collection\nclient.collections.create({\n  name: 'Article',\n  moduleConfig: { 'generative-openai': { model: 'gpt-4o' } }\n})","handlingStrategy":"validation","validationCode":"const schema = await client.collections.get('Article')\nif (!schema.moduleConfig || !Object.keys(schema.moduleConfig).some(m => m.startsWith('generative-'))) {\n  throw new Error('Collection has no generative module; enable one before querying with generate')\n}","typeGuard":"function hasGenerativeModule(cfg) {\n  return cfg != null && typeof cfg === 'object' &&\n    Object.keys(cfg).some(k => k.startsWith('generative-'))\n}","tryCatchPattern":null,"preventionTips":["Enable a generative-* module in the collection's moduleConfig at creation time","Include the module in ENABLE_MODULES and set its API-key env vars at startup","Smoke-test one generative query after deployment before going live"],"tags":["grpc","generative-search","module-configuration","weaviate"],"backgroundTag":"generative-module-not-enabled","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"}