code: func (r *SearchRequest) MarshalJSON() ([]byte, error) {
  	root := make(map[string]interface{})
  
  	root["size"] = r.Size
  	if len(r.Sort) > 0 {
  		root["sort"] = r.Sort
  	}
  
  	for key, value := range r.CustomProps {
  		root[key] = value
  	}
  
  	root["query"] = r.Query
  
  	if len(r.Aggs) > 0 {
  		root["aggs"] = r.Aggs
  	}
  
  	return json.Marshal(root)
  }
docs: // MarshalJSON returns the JSON encoding of the request.