Flowpack.ElasticSearch.ContentRepositoryAdaptor
Flowpack.ElasticSearch.ContentRepositoryAdaptor copied to clipboard
Bulk publishing leads to ElasticSearch Exception "action_request_validation_exception" for empty payload
Problem: Publishing changes might lead to the following ElasticSearch Exception:
[type] => action_request_validation_exception
[reason] => Validation Failed: 1: no requests added;
This happens if the payload is empty (we don't why this is). In this case the check in Flowpack\ElasticSearch\ContentRepositoryAdaptor\Indexer\NodeIndexer is not sufficient:
if (!isset($payload[$hash])) {
continue;
}
This can be circumvented by adding empty:
if (!isset($payload[$hash]) || empty($payload[$hash])) {
continue;
}