Skip to content

Commit

Permalink
Add deleted doc count in _cat/shards
Browse files Browse the repository at this point in the history
Signed-off-by: Shreyansh Ray <[email protected]>
  • Loading branch information
rayshrey committed Dec 28, 2023
1 parent 71d7e4d commit 78fc899
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Interpret byte array as primitive using VarHandles ([#11362](https://github.com/opensearch-project/OpenSearch/pull/11362))
- Automatically add scheme to discovery.ec2.endpoint ([#11512](https://github.com/opensearch-project/OpenSearch/pull/11512))
- Restore support for Java 8 for RestClient ([#11562](https://github.com/opensearch-project/OpenSearch/pull/11562))
- Modified _cat/shards to include deleted docs count in the response ([#11678](https://github.com/opensearch-project/OpenSearch/pull/11678))

### Deprecated

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
warmer.total_time .+ \n
path.data .+ \n
path.state .+ \n
docs.deleted .+ \n
$/
---
"Help before - 2.4.0":
Expand Down Expand Up @@ -171,6 +172,7 @@
warmer.total_time .+ \n
path.data .+ \n
path.state .+ \n
docs.deleted .+ \n
$/
---
"Test cat shards output":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ protected Table getTableWithHeader(final RestRequest request) {

table.addCell("path.data", "alias:pd,dataPath;default:false;text-align:right;desc:shard data path");
table.addCell("path.state", "alias:ps,statsPath;default:false;text-align:right;desc:shard state path");
table.addCell("docs.deleted", "alias:dd;default:false;text-align:right;desc:number of deleted docs in shard");

table.endHeaders();
return table;
Expand Down Expand Up @@ -448,6 +449,7 @@ Table buildTable(RestRequest request, ClusterStateResponse state, IndicesStatsRe

table.addCell(getOrNull(shardStats, ShardStats::getDataPath, s -> s));
table.addCell(getOrNull(shardStats, ShardStats::getStatePath, s -> s));
table.addCell(getOrNull(commonStats, CommonStats::getDocs, DocsStats::getDeleted));

table.endRow();
}
Expand Down

0 comments on commit 78fc899

Please sign in to comment.