weaviate/weaviate · error

unknown aggregation type ${aggType}

Error message

unknown aggregation type ${aggType}

What it means

This error is raised in filtered_aggregator.results() when converting accumulated property state back into GraphQL output: the property's aggType is not one of the known aggregation.PropertyTypes (text, numeric, boolean, date, reference). Unlike the parse-time variant it fires during result assembly, meaning a property was stored with an unrecognized type and only rejected when producing results.

Source

Thrown at adapters/repos/db/aggregator/filtered.go:418

			aggProp.BooleanAggregation = prop.boolAgg.Res()
			out[prop.name.String()] = aggProp
		case aggregation.PropertyTypeText:
			aggProp.TextAggregation = prop.textAgg.Res()
			out[prop.name.String()] = aggProp
		case aggregation.PropertyTypeNumerical:
			addNumericalAggregations(&aggProp, prop.specifiedAggregators,
				prop.numericalAgg)
			out[prop.name.String()] = aggProp
		case aggregation.PropertyTypeDate:
			addDateAggregations(&aggProp, prop.specifiedAggregators,
				prop.dateAgg)
			out[prop.name.String()] = aggProp
		case aggregation.PropertyTypeReference:
			addReferenceAggregations(&aggProp, prop.specifiedAggregators,
				prop.refAgg)
			out[prop.name.String()] = aggProp
		default:
			return nil, errors.New(string("unknown aggregation type " + prop.aggType))
		}
	}

	return out, nil
}

func (fa *filteredAggregator) prepareAggregatorsForProps() (propAggs, error) {
	out := propAggs{}

	for _, prop := range fa.params.Properties {
		pa := propAgg{
			name:                 prop.Name,
			specifiedAggregators: prop.Aggregators,
		}

		at, dt, err := fa.aggTypeOfProperty(prop.Name)
		if err != nil {
			return nil, errors.Wrapf(err, "property %s", prop.Name)

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Verify the aggregation request uses only supported per-property aggregators (count/mean/sum/min/max/median/mode/topOccurrences etc. as appropriate for the type)
  2. Ensure all cluster nodes run the same Weaviate version
  3. Check that the property's type in the schema supports the requested aggregation (e.g. text vs int)
  4. Capture the failing query and property name and reproduce against a single-node setup

Example fix

// before
numericField { mode } // mode unsupported for numeric type on this version
// after
numericField { mean sum min max median }
Defensive patterns

Strategy: validation

Validate before calling

// ensure each requested property aggregation matches its schema kind before querying
const kind = schema.properties[name].dataType[0] === 'text' ? 'text' : 'numeric'
if (requestedAggregatorOnlyForOtherKind(kind, agg)) throw new Error(`agg ${agg} invalid for ${kind}`)

Type guard

function isKnownPropertyType(t: string): boolean {
  return ["text","numeric","boolean","date","reference"].includes(t)
}

Prevention

When it happens

Trigger: A property whose aggType was set to something outside the aggregation.PropertyType enum — usually via the same mis-parsed GraphQL aggregation request, or by code constructing aggregation.Parameter programmatically.

Common situations: Version skew where one node serializes a property type another node's aggregator doesn't know, custom tooling building aggregation parameters directly, or enum drift after a Weaviate upgrade.

Related errors


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