Transforms can be configured to search incredibly broad index patterns. These cause the lower level actions used by transforms to iterate huge numbers of shards unless measures are taken to restrict which shards are considered using information available in cluster state.

Anywhere where transforms calls an action that iterates shards it must use the `index_filter` functionality of that action to reduce scope. Calls to be changed:

- [x] Field caps
- [x] Creating PIT readers - requires #99740 be implemented as a pre-requisite
x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/ClientTransformIndexer.java
listener.onFailure(e);
            })
        );
    }
    private static String getBulkIndexDetailedFailureMessage(String prefix, Map<String, BulkItemResponse> failures) {
        if (failures.isEmpty()) {
            return "";
        }
        StringBuilder failureMessageBuilder = new StringBuilder(prefix);
        for (Entry<String, BulkItemResponse> failure : failures.entrySet()) {
            failureMessageBuilder.append("\n[")
                .append(failure.getKey())
                .append("] message [")
                .append(failure.getValue().getFailureMessage())
                .append("]");
        }
        String failureMessage = failureMessageBuilder.toString();
        return failureMessage;
    }
    private static Throwable decorateBulkIndexException(Throwable irrecoverableException) {
        if (irrecoverableException instanceof DocumentParsingException) {
            return new TransformException(
                "Destination index mappings are incompatible with the transform configuration.",
                irrecoverableException
            );
        }
        return irrecoverableException;
    }
}