code: func (a *MatrixStatsAggregation) Source() (interface{}, error) {
  	// Example:
  	//	{
  	//    "aggs" : {
  	//      "matrixstats" : {
  	//        "matrix_stats" : {
  	//          "fields" : ["poverty", "income"],
  	//          "missing": {"income": 50000},
  	//          "mode": "avg",
  	//          ...
  	//        }
  	//      }
  	//    }
  	//	}
  	// This method returns only the { "matrix_stats" : { ... } } part.
  
  	source := make(map[string]interface{})
  	opts := make(map[string]interface{})
  	source["matrix_stats"] = opts
  
  	// MatrixStatsAggregationBuilder
  	opts["fields"] = a.fields
  	if a.missing != nil {
  		opts["missing"] = a.missing
  	}
  	if a.format != "" {
  		opts["format"] = a.format
  	}
  	if a.valueType != nil {
  		opts["value_type"] = a.valueType
  	}
  	if a.mode != "" {
  		opts["mode"] = a.mode
  	}
  
  	// AggregationBuilder (SubAggregations)
  	if len(a.subAggregations) > 0 {
  		aggsMap := make(map[string]interface{})
  		source["aggregations"] = aggsMap
  		for name, aggregate := range a.subAggregations {
  			src, err := aggregate.Source()
  			if err != nil {
  				return nil, err
  			}
  			aggsMap[name] = src
  		}
  	}
  
  	// Add Meta data if available
  	if len(a.meta) > 0 {
  		source["meta"] = a.meta
  	}
  
  	return source, nil
  }
docs: // Source returns the JSON to serialize into the request, or an error.