private SystemInfoResult getSystemInfo(final long shardId,
                                           final Integer limit,
                                           final Long streamId) {
        try {
            final Optional<IndexShard> optional = indexShardDao.fetch(shardId);
            if (optional.isEmpty()) {
                throw new RuntimeException("Unknown shardId " + shardId);
            }
            final IndexShard indexShard = optional.get();
            if (doesThisNodeOwnTheShard(indexShard)) {
                final LuceneVersion luceneVersion = LuceneVersionUtil.getLuceneVersion(indexShard.getIndexVersion());
                return luceneProviderFactory.get(luceneVersion)
                        .getIndexSystemInfoProvider()
                        .getSystemInfo(indexShard, limit, streamId);
            } else {
                return SystemInfoResult.builder(this)
                        .addDetail("ShardId", indexShard.getId())
                        .addDetail("ThisNode", nodeInfo.getThisNodeName())
                        .addDetail("OwningNode", indexShard.getNodeName())
                        .addDetail("Owned", false)
                        .build();
            }
        } catch (RuntimeException e) {
            return SystemInfoResult.builder(this)
                    .addError(e)
                    .build();
        }
    }
Provides system information for inspecting index shards.
Gets counts of documents grouped by stream id.
Requires the shardId as a query parameter.
stroom-index/stroom-index-impl/src/main/java/stroom/index/impl/IndexSystemInfo.java