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/test/java/org/elasticsearch/script/field/IPAddressTests.java
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */
package org.elasticsearch.script.field;
import org.elasticsearch.test.ESTestCase;
public class IPAddressTests extends ESTestCase {
    public void testToString() {
        String v4 = "192.168.7.255";
        assertEquals(v4, new IPAddress(v4).toString());
        String v6 = "b181:3a88:339c:97f5:2b40:5175:bf3d:f77e";
        assertEquals(v6, new IPAddress(v6).toString());
    }
    public void testV4() {
        IPAddress addr4 = new IPAddress("169.254.0.0");
        assertTrue(addr4.isV4());
        assertFalse(addr4.isV6());
    }
    public void testV6() {
        IPAddress addr4 = new IPAddress("b181:3a88:339c:97f5:2b40:5175:bf3d:f77e");
        assertFalse(addr4.isV4());
        assertTrue(addr4.isV6());
    }
}