I am writing an RDD to Elasticsearch using the
saveToEs method from elasticsearch-spark. The RDD might contain documents that Elasticsearch rejects with a
org.elasticsearch.hadoop.rest.EsHadoopInvalidRequest exception, and I would like to catch the exception(s) in order to just ignore such malformed documents, so that the job does not get interrupted. How can I do this?