diff --git a/server/src/main/java/org/opensearch/action/pagination/ShardPaginationStrategy.java b/server/src/main/java/org/opensearch/action/pagination/ShardPaginationStrategy.java index 9a73f31a144e8..1eb364c883e60 100644 --- a/server/src/main/java/org/opensearch/action/pagination/ShardPaginationStrategy.java +++ b/server/src/main/java/org/opensearch/action/pagination/ShardPaginationStrategy.java @@ -113,7 +113,9 @@ private PageData getPageData( Map indexShardRoutingTable = indicesRouting.get(indexName).getShards(); for (; startShardId < indexShardRoutingTable.size(); startShardId++) { if (indexShardRoutingTable.get(startShardId).size() > numShardsRequired) { - throw new IllegalArgumentException("size value should be greater than the replica count of all indices"); + throw new IllegalArgumentException( + "size value should be greater than the replica count of all indices, so that all primary and replicas of a shard show up in single page" + ); } shardCount += indexShardRoutingTable.get(startShardId).size(); if (shardCount > numShardsRequired) {