如果文档不存在,如何在使用 pyspark 进行批量更新时忽略异常

How to ignore exceptions when bulk update with pyspark if doc doesn't exist

我正在尝试使用 pyspark 中的 elasticsearch hadoop 包进行更新操作。它在文档中说,如果找不到数据,则会抛出异常。在 pyspark 中忽略此异常的最佳方法是什么?或者是否可以通过 raise_on_exception=False,raise_on_error=False 提供 python elasticsearch API?谢谢!

终于在这里得到答案:https://discuss.elastic.co/t/how-to-ignore-exceptions-when-bulk-update-with-pyspark-if-doc-doesnt-exist/90739/2

"there is no way to suppress the error when it occurs. If a value is missing when an update is executed, there's nothing for the connector to do but fail the task."