### Elasticsearch Version

8.10

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

Darwin michaels-mbp.lan 22.6.0 Darwin Kernel Version 22.6.0: Fri Sep 15 13:41:28 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_ARM64_T6000 arm64

### Problem Description

Cross cluster searches done with `ccs_minimize_roundtrips=true` (the default in Kibana as of version 8.10) inappropriately marks searches on remote clusters as "failed" or "skipped" when there are no shards to search (e.g., when that index is not present on the remote cluster). Those clusters should instead be reporting as successful. See "Steps to Reproduce" section for an example of correct vs. incorrect behavior.

This bug causes: https://github.com/elastic/elasticsearch/issues/100311

### Steps to Reproduce

Do a cross-cluster where one or more of the remote clusters lacks an index and query with ccs_minimize_roundtrips=true.

Example:

```
POST *,remote*:blog*/_async_search?ccs_minimize_roundtrips=true
{
  "size": 1,
  "query": {
    "match_all": {}
  }
}  
```

Result:

```
    "_clusters": {
      "total": 3,
      "successful": 1,
      "skipped": 1,
      "running": 0,
      "partial": 0,
      "failed": 1,
      "details": {
        "(local)": {
          "status": "successful",
          "indices": "*",
          "took": 24,
          "timed_out": false,
          "_shards": {
            "total": 2,
            "successful": 2,
            "skipped": 0,
            "failed": 0
          }
        },
        "remote2": {
          "status": "skipped",
          "indices": "blog*",
          "took": 2,
          "timed_out": false,
          "_shards": {
            "total": 0,
            "successful": 0,
            "skipped": 0,
            "failed": 0
          }
        },
        "remote1": {
          "status": "failed",
          "indices": "blog*",
          "took": 0,
          "timed_out": false,
          "_shards": {
            "total": 0,
            "successful": 0,
            "skipped": 0,
            "failed": 0
          }
        }
      }
    },
```

The correct response (which you get with ccs_minimize_roundtrips=false) should be:

```
   "_clusters": {
      "total": 3,
      "successful": 3,
      "skipped": 0,
      "running": 0,
      "partial": 0,
      "failed": 0,
      "details": {
        "(local)": {
          "status": "successful",
          "indices": "*",
          "took": 21,
          "timed_out": false,
          "_shards": {
            "total": 2,
            "successful": 2,
            "skipped": 0,
            "failed": 0
          }
        },
        "remote2": {
          "status": "successful",
          "indices": "blog*",
          "took": 16,
          "timed_out": false,
          "_shards": {
            "total": 0,
            "successful": 0,
            "skipped": 0,
            "failed": 0
          }
        },
        "remote1": {
          "status": "successful",
          "indices": "blog*",
          "took": 16,
          "timed_out": false,
          "_shards": {
            "total": 0,
            "successful": 0,
            "skipped": 0,
            "failed": 0
          }
        }
      }
    },
```



### Logs (if relevant)

_No response_
server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java
return indices.entrySet()
            .stream()
            .collect(Collectors.toMap(Map.Entry::getKey, e -> new OriginalIndices(e.getValue().toArray(String[]::new), indicesOptions)));
    }
    static List<SearchShardIterator> getLocalLocalShardsIteratorFromPointInTime(
        ClusterState clusterState,
        OriginalIndices originalIndices,
        String localClusterAlias,
        SearchContextId searchContext,
        TimeValue keepAlive,
        boolean allowPartialSearchResults
    ) {
        final List<SearchShardIterator> iterators = new ArrayList<>(searchContext.shards().size());
        for (Map.Entry<ShardId, SearchContextIdForNode> entry : searchContext.shards().entrySet()) {
            final SearchContextIdForNode perNode = entry.getValue();
            if (Strings.isEmpty(perNode.getClusterAlias())) {
                final ShardId shardId = entry.getKey();
                final List<String> targetNodes = new ArrayList<>(2);
                try {
                    final ShardIterator shards = OperationRouting.getShards(clusterState, shardId);
                    
                    if (clusterState.nodes().nodeExists(perNode.getNode())) {
                        targetNodes.add(perNode.getNode());
                    }
                    if (perNode.getSearchContextId().getSearcherId() != null) {
                        for (ShardRouting shard : shards) {
                            if (shard.currentNodeId().equals(perNode.getNode()) == false) {
                                targetNodes.add(shard.currentNodeId());
                            }
                        }