### Elasticsearch Version

main

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

Darwin

### Problem Description

Sorting fails sometimes with the error

```
No TopN sorting encoder for type UNSUPPORTED
```


### Steps to Reproduce

Playing with ES|QL I tried to run the following query

`from logstash-* | sort extension.keyword`

This returns the error

```
No TopN sorting encoder for type UNSUPPORTED
```

If I run the query:

`from logstash-*  | keep extension.keyword | sort extension.keyword`

the data return successfully.

### Logs (if relevant)

_No response_
x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/lucene/ValueSources.java
ctx.getIndexReader()
            );
            case BOOLEAN -> new ValueSourceInfo(
                CoreValuesSourceType.BOOLEAN,
                ValuesSource.Numeric.EMPTY,
                elementType,
                ctx.getIndexReader()
            );
            case DOUBLE -> new ValueSourceInfo(CoreValuesSourceType.NUMERIC, new ValuesSource.Numeric() {
                @Override
                public boolean isFloatingPoint() {
                    return true;
                }
                @Override
                public SortedNumericDocValues longValues(LeafReaderContext context) {
                    return DocValues.emptySortedNumeric();
                }
                @Override
                public SortedNumericDoubleValues doubleValues(LeafReaderContext context) throws IOException {
                    return org.elasticsearch.index.fielddata.FieldData.emptySortedNumericDoubles();
                }
                @Override
                public SortedBinaryDocValues bytesValues(LeafReaderContext context) throws IOException {
                    return org.elasticsearch.index.fielddata.FieldData.emptySortedBinary();
                }
            }, elementType, ctx.getIndexReader());
            default -> throw e;
        };
    }
    private static TextValueSource textValueSource(SearchExecutionContext ctx, MappedFieldType fieldType) {