weaviate/weaviate · error

enable-searchable requires targetTokenization

Error message

enable-searchable requires targetTokenization

What it means

The enable-searchable reindex arm requires a TargetTokenization in the payload: the migration exists to convert a property's inverted index to the searchable (tokenized) strategy, and without a target tokenization the task cannot know how to tokenize text during the rebuild.

Source

Thrown at adapters/repos/db/reindex_provider.go:742

		if !ok {
			return nil, nil
		}
		return []*ShardReindexTaskGeneric{
			NewRuntimeFilterableToRangeableTask(p.logger, p.schemaManager, payload.Properties, payload.Collection, gen),
		}, nil

	case ReindexTypeEnableFilterable:
		gen, ok := genFor(MigrationDirPrefixEnableFilterable, propsSuffix(payload.Properties))
		if !ok {
			return nil, nil
		}
		return []*ShardReindexTaskGeneric{
			NewRuntimeEnableFilterableTask(p.logger, payload.Properties, payload.Collection, gen),
		}, nil

	case ReindexTypeEnableSearchable:
		if payload.TargetTokenization == "" {
			return nil, fmt.Errorf("enable-searchable requires targetTokenization")
		}
		gen, ok := genFor(MigrationDirPrefixEnableSearchable, propsSuffix(payload.Properties))
		if !ok {
			return nil, nil
		}
		return []*ShardReindexTaskGeneric{
			NewRuntimeEnableSearchableTask(p.logger, payload.Properties, payload.Collection, payload.TargetTokenization, gen),
		}, nil

	case ReindexTypeChangeTokenization:
		if len(payload.Properties) != 1 {
			return nil, fmt.Errorf("change-tokenization requires exactly one property")
		}
		propName := payload.Properties[0]
		if payload.TargetTokenization == "" {
			return nil, fmt.Errorf("change-tokenization requires targetTokenization")
		}
		if payload.BucketStrategy == "" {

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Re-issue the enable-searchable request with targetTokenization set (e.g. "word").
  2. Ensure the property's configured tokenization in the schema is copied into the payload when building the task.
  3. Fix the calling code/SDK binding that drops the targetTokenization field.

Example fix

// before
payload := &ReindexTaskPayload{MigrationType: ReindexTypeEnableSearchable, Properties: []string{"text"}}
// error: enable-searchable requires targetTokenization

// after
payload := &ReindexTaskPayload{MigrationType: ReindexTypeEnableSearchable, Properties: []string{"text"}, TargetTokenization: "word"}
Defensive patterns

Strategy: validation

Validate before calling

if migrationType == "enable-searchable" && targetTokenization == "" { return errors.New("targetTokenization is required for enable-searchable") }

Type guard

func searchablePayloadValid(p *ReindexTaskPayload) bool { return p.MigrationType != ReindexTypeEnableSearchable || p.TargetTokenization != "" }

Try / catch

err := startReindex(payload)
if err != nil && strings.Contains(err.Error(), "enable-searchable requires targetTokenization") {
  // set TargetTokenization (e.g. "word") and retry
}

Prevention

When it happens

Trigger: Creating an enable-searchable reindex task with payload.TargetTokenization empty — e.g. the API request omitted the target tokenization or the serializer dropped it.

Common situations: Client SDK call enabling searchable on a text property without specifying tokenization (word, lowercase, whitespace, trigram, field, gse, kagome_*); copying a payload template from enable-filterable which has no tokenization field.

Related errors


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