private static int GetCellsCount(IndexerClient indexerClient, SearchKey searchKey) { string?afterCursor = null; int totalCount = 0; int limit = 100; while (true) { var result = indexerClient.GetCells(searchKey, limit: limit, afterCursor: afterCursor); if (result == null || result.LastCursor == null) { break; } afterCursor = result.LastCursor; int count = result.Objects.Length; totalCount += count; if (count < limit) { break; } } return(totalCount); }