### Elasticsearch Version

8.9.0+

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

all

### Problem Description

Beginning in 8.9.0, observing cardinality aggs returning zero against `constant_keyword` mapped fields.

### Steps to Reproduce

Performed simple setup of an index with `constant_keyword` mapping for field `test` in 8.8.2 and 8.9.0:

```json
PUT test-index
{
  "mappings": {
    "properties": {
      "test": {
        "type": "constant_keyword"
      }
    }
  }
}

PUT test-index/_bulk
{ "index" : { "_index" : "test-index", "_id" : "1" } }
{ "test" : "value1" }



GET test-index/_search
{
  "aggs": {
    "0": {
      "cardinality": {
        "field": "test"
      }
    }
  },
  "size": 0
}
```

8.8.2 result

```json
{
  "took": 1,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": null,
    "hits": []
  },
  "aggregations": {
    "0": {
      "value": 1 <= expected
    }
  }
}
```

8.9.0 result

```json
{
  "took": 2,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": null,
    "hits": []
  },
  "aggregations": {
    "0": {
      "value": 0 <= unexpected
    }
  }
}
```

Also see a zero value when querying `constant_keyword` values across indices:

```
# `test` already mapped as `constant_keyword` for `test-index-*`
PUT test-index/_bulk
{ "index" : { "_index" : "test-index-0001", "_id" : "1" } }
{ "test" : "value1" }
{ "index" : { "_index" : "test-index-0002", "_id" : "2" } }
{ "test" : "value2" }
{ "index" : { "_index" : "test-index-0003", "_id" : "3" } }
{ "test" : "value3" }
{ "index" : { "_index" : "test-index-0004", "_id" : "4" } }
{ "test" : "value4" }
{ "index" : { "_index" : "test-index-0005", "_id" : "5" } }
{ "test" : "value5" }



GET test-index-*/_search
{
  "aggs": {
    "0": {
      "cardinality": {
        "field": "test"
      }
    }
  },
  "size": 0
}
```

### Logs (if relevant)

_No response_
server/src/main/java/org/elasticsearch/search/aggregations/metrics/GlobalOrdCardinalityAggregator.java
private static final int MAX_FIELD_CARDINALITY_FOR_DYNAMIC_PRUNING = 1024;
    
    private static final int MAX_TERMS_FOR_DYNAMIC_PRUNING = 128;
    private final ValuesSource.Bytes.WithOrdinals valuesSource;
    
    
    private final String field;
    private final BigArrays bigArrays;
    private final int maxOrd;
    private final int precision;
    private int dynamicPruningAttempts;
    private int dynamicPruningSuccess;
    private int bruteForce;
    private int noData;
    
    @Nullable
    private HyperLogLogPlusPlusSparse counts;
    private ObjectArray<BitArray> visitedOrds;
    private SortedSetDocValues values;
    public GlobalOrdCardinalityAggregator(
        String name,