weaviate/weaviate · error

No results for generative search despite a search request. I

Error message

No results for generative search despite a search request. Is a generative module enabled?

What it means

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.

Source

Thrown at adapters/handlers/grpc/v1/prepare_reply.go:459

		Name:            group.GroupedBy.Value,
		MaxDistance:     group.MaxDistance,
		MinDistance:     group.MinDistance,
		NumberOfObjects: int64(group.Count),
	}

	groupedGenerativeResults := ""
	if generativeSearchEnabled {
		generateFmt, err := extractGenerateResult(addProps)
		if err != nil {
			return nil, "", err
		}

		generativeSearch, ok := generativeSearchRaw.(*generate.Params)
		if !ok {
			return nil, "", errors.New("could not cast generative search params")
		}
		if generativeSearch.Prompt != nil && generateFmt.SingleResult == nil {
			return nil, "", errors.New("No results for generative search despite a search request. Is a generative module enabled?")
		}

		if generateFmt.Error != nil {
			return nil, "", generateFmt.Error
		}

		if generateFmt.SingleResult != nil && *generateFmt.SingleResult != "" {
			ret.Generative = &pb.GenerativeReply{Result: *generateFmt.SingleResult}
		}

		// grouped results are only added to the first object for GQL reasons
		// however, reranking can result in a different order, so we need to check every object
		// recording the result if it's present assuming that it is at least somewhere and will be caught
		if generateFmt.GroupedResult != nil && *generateFmt.GroupedResult != "" {
			groupedGenerativeResults = *generateFmt.GroupedResult
		}
	}

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. 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
  2. Verify with GraphQL introspection or /v1/schema that the collection's moduleConfig contains a generative-* module
  3. Check that required module env vars (e.g. OPENAI_APIKEY) are set so the module can actually produce results
  4. Re-run the search and confirm the _additional.generate.singleResult field is populated

Example fix

// before — collection created without a generative module
client.collections.create({ name: 'Article' })

// after — enable a generative module on the collection
client.collections.create({
  name: 'Article',
  moduleConfig: { 'generative-openai': { model: 'gpt-4o' } }
})
Defensive patterns

Strategy: validation

Validate before calling

const schema = await client.collections.get('Article')
if (!schema.moduleConfig || !Object.keys(schema.moduleConfig).some(m => m.startsWith('generative-'))) {
  throw new Error('Collection has no generative module; enable one before querying with generate')
}

Type guard

function hasGenerativeModule(cfg) {
  return cfg != null && typeof cfg === 'object' &&
    Object.keys(cfg).some(k => k.startsWith('generative-'))
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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