### Elasticsearch Version

v8.10

RRF produces inconsistent ranking between primary and replica shards when documents from different queries have the same rank.
For example, if: 
doc1 has a rank 1 in the hits set for Query1 (and is not present in the hit set for Query 2)
doc2 has a rank 1 in the hits set for Query2 (and is not present in the hit set for Query 1)

documents doc1 and doc2 could be ranked differently : [doc1, doc2] and [doc2, doc1] depending which shard search will hit.

### Steps to Reproduce

To be provided

### A solution

This happens because for tie breaking, we use internal doc IDs, which is dependant on a shard. Instead we can use an original query ID or order to ensure consistent ordering.

x-pack/plugin/rank-rrf/src/test/java/org/elasticsearch/xpack/rank/rrf/RRFRankContextTests.java
RRFRankDoc rd22 = new RRFRankDoc(2, -1, 2);
        rd22.positions[0] = 1;
        rd22.positions[1] = 1;
        rd22.scores[0] = 8.5f;
        rd22.scores[1] = 6.5f;
        RRFRankDoc rd23 = new RRFRankDoc(3, -1, 2);
        rd23.positions[0] = 2;
        rd23.positions[1] = 2;
        rd23.scores[0] = 7.5f;
        rd23.scores[1] = 4.5f;
        RRFRankDoc rd24 = new RRFRankDoc(4, -1, 2);
        rd24.positions[0] = 3;
        rd24.positions[1] = NO_RANK;
        rd24.scores[0] = 5.5f;
        rd24.scores[1] = 0.0f;
        RRFRankDoc rd25 = new RRFRankDoc(5, -1, 2);
        rd25.positions[0] = NO_RANK;
        rd25.positions[1] = 3;
        rd25.scores[0] = 0.0f;
        rd25.scores[1] = 4.5f;
        qsr1.setRankShardResult(new RRFRankShardResult(2, new RRFRankDoc[] { rd21, rd22, rd23, rd24, rd25 }));
        TopDocsStats tds = new TopDocsStats(0);
        SortedTopDocs std = context.rank(List.of(qsr0, qsr1), tds);
        assertEquals(4, tds.fetchHits);
        assertEquals(4, std.scoreDocs().length);
        RRFRankDoc expected = new RRFRankDoc(1, 2, 2);
        expected.rank = 1;
        expected.positions[0] = 1;
        expected.positions[1] = 1;
        expected.scores[0] = 9.5f;