func MockIndex(dm *bleve.DocumentMapping) (bleve.Index, error) {
	mapping := bleve.NewIndexMapping()
	mapping.AddDocumentMapping("image", dm)
	mapping.DefaultField = "_all"
	return bleve.NewMemOnly(mapping)
}
MockIndex creates a bleve Index for tests
package indextest
import (
	"time"
	"github.com/Sirupsen/logrus"
	"github.com/blevesearch/bleve"
)
func ParseTime(value string) time.Time {
	t, err := time.Parse(time.RFC3339, value)
	if err != nil {
		logrus.WithError(err).WithField("time", value).Error("failed to parse datetime")
	}
	return t
}