**Build scan:**
https://gradle-enterprise.elastic.co/s/fjxuohetdjmqq/tests/:server:test/org.elasticsearch.search.suggest.SuggestTests/testSerialization

**Reproduction line:**
```
./gradlew ':server:test' --tests "org.elasticsearch.search.suggest.SuggestTests.testSerialization" -Dtests.seed=7C2E1080054FE574 -Dtests.locale=mk -Dtests.timezone=Chile/EasterIsland -Druntime.java=20
```

**Applicable branches:**
main

**Reproduces locally?:**
Yes

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.search.suggest.SuggestTests&tests.test=testSerialization

**Failure excerpt:**
```
java.lang.IllegalArgumentException: cannot serialize [rank] to version [8060299]

  at __randomizedtesting.SeedInfo.seed([7C2E1080054FE574:28F671C8221DD8E8]:0)
  at org.elasticsearch.search.SearchHit.writeTo(SearchHit.java:248)
  at org.elasticsearch.search.suggest.completion.CompletionSuggestion$Entry$Option.writeTo(CompletionSuggestion.java:408)
  at org.elasticsearch.common.io.stream.StreamOutput.lambda$writeCollection$33(StreamOutput.java:1026)
  at org.elasticsearch.common.io.stream.StreamOutput.writeCollection(StreamOutput.java:1045)
  at org.elasticsearch.common.io.stream.StreamOutput.writeCollection(StreamOutput.java:1026)
  at org.elasticsearch.search.suggest.Suggest$Suggestion$Entry.writeTo(Suggest.java:545)
  at org.elasticsearch.common.io.stream.StreamOutput.lambda$writeCollection$33(StreamOutput.java:1026)
  at org.elasticsearch.common.io.stream.StreamOutput.writeCollection(StreamOutput.java:1045)
  at org.elasticsearch.common.io.stream.StreamOutput.writeCollection(StreamOutput.java:1026)
  at org.elasticsearch.common.io.stream.StreamOutput.writeList(StreamOutput.java:1033)
  at org.elasticsearch.search.suggest.Suggest$Suggestion.writeTo(Suggest.java:320)
  at org.elasticsearch.search.suggest.completion.CompletionSuggestion.writeTo(CompletionSuggestion.java:84)
  at org.elasticsearch.common.io.stream.StreamOutput.writeNamedWriteable(StreamOutput.java:976)
  at org.elasticsearch.common.io.stream.StreamOutput.writeNamedWriteableList(StreamOutput.java:1098)
  at org.elasticsearch.search.suggest.Suggest.writeTo(Suggest.java:115)
  at org.elasticsearch.search.suggest.SuggestTests.testSerialization(SuggestTests.java:255)
  at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
  at java.lang.reflect.Method.invoke(Method.java:578)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:946)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:982)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:996)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:48)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:843)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:490)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:955)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)
  at java.lang.Thread.run(Thread.java:1623)

```
server/src/test/java/org/elasticsearch/search/suggest/SuggestTests.java
return namedXContents;
    }
    static NamedXContentRegistry getSuggestersRegistry() {
        return xContentRegistry;
    }
    @Override
    protected NamedXContentRegistry xContentRegistry() {
        return getSuggestersRegistry();
    }
    public static Suggest createTestItem() {
        int numEntries = randomIntBetween(0, 5);
        List<Suggestion<? extends Entry<? extends Option>>> suggestions = new ArrayList<>();
        for (int i = 0; i < numEntries; i++) {
            suggestions.add(SuggestionTests.createTestItem());
        }
        return new Suggest(suggestions);
    }
    public void testFromXContent() throws IOException {
        ToXContent.Params params = new ToXContent.MapParams(Collections.singletonMap(RestSearchAction.TYPED_KEYS_PARAM, "true"));
        Suggest suggest = createTestItem();
        XContentType xContentType = randomFrom(XContentType.values());
        boolean humanReadable = randomBoolean();
        BytesReference originalBytes = toShuffledXContent(suggest, xContentType, params, humanReadable);
        Suggest parsed;
        try (XContentParser parser = createParser(xContentType.xContent(), originalBytes)) {
            ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.nextToken(), parser);
            ensureFieldName(parser, parser.nextToken(), Suggest.NAME);
            ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.nextToken(), parser);
            parsed = Suggest.fromXContent(parser);
            assertEquals(XContentParser.Token.END_OBJECT, parser.currentToken());