### Elasticsearch Version

8.10.3

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

docker

### Problem Description

Cannot sort by field if there are blank values
{
  "name": "es-1-master-2",
  "cluster_name": "es-1",
  "cluster_uuid": "kQ8-xy6FQeqjR8Zmc_a9HQ",
  "version": {
    "number": "8.10.3",
    "build_flavor": "default",
    "build_type": "docker",
    "build_hash": "c63272efed16b5a1c25f3ce500715b7fddf9a9fb",
    "build_date": "2023-10-05T10:15:55.152563867Z",
    "build_snapshot": false,
    "lucene_version": "9.7.0",
    "minimum_wire_compatibility_version": "7.17.0",
    "minimum_index_compatibility_version": "7.0.0"
  },
  "tagline": "You Know, for Search"
}

### Steps to Reproduce

Steps to recreate issue.
From kibana add sample data sets ['Sample flight data','Sample eCommerce orders']
Create dataview
name:test
index patter:kibana_*
timefield: --- I don't want to use the time filter ---

From discover sort by AvgTicketPrice, or run query
```
POST kibana_*/_search
{
    "sort": [
        {
            "AvgTicketPrice": {
                "order": "desc",
                "unmapped_type": "boolean"
            }
        }
    ],
    "fields": [
        {
            "field": "*",
            "include_unmapped": "true"
        }
    ],
    "size": 500
}
```
Can't sort on field [AvgTicketPrice]; the field has incompatible sort types: [LONG] and [FLOAT] across shards!

### Logs (if relevant)

_No response_
server/src/internalClusterTest/java/org/elasticsearch/search/sort/FieldSortIT.java
true,
            prepareIndex("test").setId("1").setSource("ip", "192.168.1.7"),
            prepareIndex("test").setId("2").setSource("ip", "2001:db8::ff00:42:8329")
        );
        assertNoFailuresAndResponse(prepareSearch("test").addSort(SortBuilders.fieldSort("ip")), response -> {
            assertEquals(2, response.getHits().getTotalHits().value);
            assertArrayEquals(new String[] { "192.168.1.7" }, response.getHits().getAt(0).getSortValues());
            assertArrayEquals(new String[] { "2001:db8::ff00:42:8329" }, response.getHits().getAt(1).getSortValues());
        });
        assertNoFailuresAndResponse(
            prepareSearch("test").addSort(SortBuilders.fieldSort("ip")).searchAfter(new Object[] { "192.168.1.7" }),
            response -> {
                assertEquals(2, response.getHits().getTotalHits().value);
                assertEquals(1, response.getHits().getHits().length);
                assertArrayEquals(new String[] { "2001:db8::ff00:42:8329" }, response.getHits().getAt(0).getSortValues());
            }
        );
    }
    public void testScriptFieldSort() throws Exception {
        assertAcked(prepareCreate("test").setMapping("keyword", "type=keyword", "number", "type=integer"));
        ensureGreen();
        final int numDocs = randomIntBetween(10, 20);
        IndexRequestBuilder[] indexReqs = new IndexRequestBuilder[numDocs];
        List<String> keywords = new ArrayList<>();
        for (int i = 0; i < numDocs; ++i) {
            indexReqs[i] = prepareIndex("test").setSource("number", i, "keyword", Integer.toString(i));
            keywords.add(Integer.toString(i));
        }
        Collections.sort(keywords);
        indexRandom(true, indexReqs);