def document_get(index, id, doc_type='_all', hosts=None, profile=None):
 es = _get_instance(hosts, profile)
 try:
  ret = es.get(index=index, id=id, doc_type=doc_type)
  return ret
 except elasticsearch.exceptions.NotFoundError:
  return None
 return None

def document_get ( index , id , doc_type = '_all' , hosts = None , profile = None ) : es = _get_instance ( hosts , profile ) try : ret = es . get ( index = index , id = id , doc_type = doc_type ) return ret except elasticsearch . exceptions . NotFoundError : return None return None
check for the existence of a document and if it exists .