def document_create(index, doc_type, body=None, id=None, hosts=None, profile=None):
 es = _get_instance(hosts, profile)
 try:
  result = es.index(index=index, doc_type=doc_type, body=body, id=id)
  return True
 except elasticsearch.exceptions.NotFoundError:
  return None
 return None

def document_create ( index , doc_type , body = None , id = None , hosts = None , profile = None ) : es = _get_instance ( hosts , profile ) try : result = es . index ( index = index , doc_type = doc_type , body = body , id = id ) return True except elasticsearch . exceptions . NotFoundError : return None return None
create a document in a specified index cli example:: salt myminion elasticsearch .