func (s *BulkService) estimateSizeInBytes(r BulkableRequest) int64 {
	lines, _ := r.Source()
	size := 0
	for _, line := range lines {
		size += len(line) + 1
	}
	return int64(size)
}
estimateSizeInBytes returns the estimates size of the given
bulkable request, i.e. BulkIndexRequest, BulkUpdateRequest, and
BulkDeleteRequest.
package elastic
import (
	"bytes"
	"errors"
	"fmt"
	"net/url"
	"gopkg.in/olivere/elastic.v3/uritemplates"
)
type BulkService struct {
	client *Client
	index    string
	typ      string
	requests []BulkableRequest
	timeout  string
	refresh  *bool
	pretty   bool
	sizeInBytes int64
}
func NewBulkService(client *Client) *BulkService {
	builder := &BulkService{
		client:   client,
		requests: make([]BulkableRequest, 0),
	}
	return builder
}
func (s *BulkService) reset() {
	s.requests = make([]BulkableRequest, 0)
	s.sizeInBytes = 0
}
func (s *BulkService) Index(index string) *BulkService {
	s.index = index
	return s
}
func (s *BulkService) Type(typ string) *BulkService {
	s.typ = typ
	return s
}
func (s *BulkService) Timeout(timeout string) *BulkService {
	s.timeout = timeout
	return s
}
func (s *BulkService) Refresh(refresh bool) *BulkService {
	s.refresh = &refresh
	return s
}
func (s *BulkService) Pretty(pretty bool) *BulkService {
	s.pretty = pretty
	return s
}
func (s *BulkService) Add(requests ...BulkableRequest) *BulkService {
	for _, r := range requests {
		s.requests = append(s.requests, r)
		s.sizeInBytes += s.estimateSizeInBytes(r)
	}
	return s
}
func (s *BulkService) EstimatedSizeInBytes() int64 {
	return s.sizeInBytes
}