### 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/main/java/org/elasticsearch/xpack/rank/rrf/RRFRankShardContext.java
protected final int rankConstant;
    public RRFRankShardContext(List<Query> queries, int from, int windowSize, int rankConstant) {
        super(queries, from, windowSize);
        this.rankConstant = rankConstant;
    }
    @Override
    public RRFRankShardResult combine(List<TopDocs> rankResults) {
        
        
        
        
        
        int queries = rankResults.size();
        Map<Integer, RRFRankDoc> docsToRankResults = Maps.newMapWithExpectedSize(windowSize);
        int index = 0;
        for (TopDocs rrfRankResult : rankResults) {
            int rank = 1;
            for (ScoreDoc scoreDoc : rrfRankResult.scoreDocs) {
                final int findex = index;
                final int frank = rank;
                docsToRankResults.compute(scoreDoc.doc, (key, value) -> {
                    if (value == null) {
                        value = new RRFRankDoc(scoreDoc.doc, scoreDoc.shardIndex, queries);
                    }
                    
                    
                    value.score += 1.0f / (rankConstant + frank);