While experimenting with painless tests in a multi-node cluster I hit the following error. We're failing to serialize this type, which looks to be because it's not implementing `GenericNamedWritable` when it should.

```
[2023-10-19T01:22:02,328][WARN ][o.e.t.OutboundHandler    ] [search-MxNysuL] failed to serialize outbound message [Response{821}{false}{false}{false}{class org.elasticsearch.search.fetch.QueryFetchSearchResult}] java.lang.IllegalArgumentException: can not write type [class org.elasticsearch.script.field.IPAddress]
	at org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.common.io.stream.StreamOutput.writeGenericValue(StreamOutput.java:839)
	at org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.common.io.stream.StreamOutput.writeCollection(StreamOutput.java:1050)
	at org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.common.document.DocumentField.writeTo(DocumentField.java:116)
	at org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.common.io.stream.StreamOutput.writeWriteable(StreamOutput.java:981)
	at org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.common.io.stream.StreamOutput.writeMap(StreamOutput.java:602)
	at org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.common.io.stream.StreamOutput.writeMap(StreamOutput.java:610)
	at org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.search.SearchHit.writeTo(SearchHit.java:267)
```
server/src/main/java/org/elasticsearch/script/field/IPAddress.java
protected final InetAddress address;
    IPAddress(InetAddress address) {
        this.address = address;
    }
    public IPAddress(String address) {
        this.address = InetAddresses.forString(address);
    }
    public boolean isV4() {
        return address instanceof Inet4Address;
    }
    public boolean isV6() {
        return address instanceof Inet6Address;
    }
    @Override
    public String toString() {
        return InetAddresses.toAddrString(address);
    }
    @Override
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
        return builder.value(this.toString());
    }
}