code: function createElasticsearch (args, model) {
      // get client - throw error if not set
      var elasticsearchClient = model.elasticsearch()
      // document to store in elastic search
      var body
      // use raw data to build body
      if (args.raw) {
          body = elasticSearchBodyFromRaw(model, args.raw)
      }
      // use record to build body
      else if (args.record) {
          body = elasticSearchBodyFromRecord(model, args.record)
      }
      else {
          // ignore errors
          return
      }
      // get id from originalId or id
      var id = body.originalId || body.id
      // if instance does not have id cannot store
      if (!id) {
          // ignore errors
          return
      }
      // get record type
      var type = model.esType
          ? _.get(body.data, model.esType) || model.name
          : model.name
      // if record is deleted then delete from elasticsearch
      if (body.isDeleted) {
          return elasticsearchClient.delete({
              id: id,
              index: model.esIndex,
              type: type,
          })
          // ignore error
          .catch(console.error)
      }
      // otherwise create/update record with elasticsearch
      else {
          return elasticsearchClient.index({
              body: body,
              id: id,
              index: model.esIndex,
              type: type,
          })
          // ignore error
          .catch(console.error)
      }
  }
docs: /* private functions 
  @function createElasticsearch
  
  create record in elasticsearch
  
  @param {object} args
  @param {object} model
  
  @returns {Promise}