func (b *Batch) Size() int {
	return len(b.internal.IndexOps) + len(b.internal.InternalOps)
}
Size returns the total number of operations inside the batch
including normal index operations and internal operations.
package bleve
import (
	"github.com/blevesearch/bleve/document"
	"github.com/blevesearch/bleve/index"
	"github.com/blevesearch/bleve/index/store"
	"golang.org/x/net/context"
)
type Batch struct {
	index    Index
	internal *index.Batch
}
func (b *Batch) Index(id string, data interface{}) error {
	if id == "" {
		return ErrorEmptyID
	}
	doc := document.NewDocument(id)
	err := b.index.Mapping().mapDocument(doc, data)
	if err != nil {
		return err
	}
	b.internal.Update(doc)
	return nil
}
func (b *Batch) Delete(id string) {
	if id != "" {
		b.internal.Delete(id)
	}
}
func (b *Batch) SetInternal(key, val []byte) {
	b.internal.SetInternal(key, val)
}
func (b *Batch) DeleteInternal(key []byte) {
	b.internal.DeleteInternal(key)
}