private static void AddOperationDocument(InnerBulkOperation operation, StringBuilder sb)
        {
            string json = JsonConvert.SerializeObject(operation.Document);

            sb.Append(json);
            sb.Append("\n");
        }
        private static void AddOperationMetadata(InnerBulkOperation operation, StringBuilder sb)
        {
            var indexParams = new Dictionary <string, string>(operation.IndexOperationParams)
            {
                { "_index", operation.IndexName },
                { "_type", operation.IndexType },
            };
            var paramStrings = indexParams
                               .Where(kv => kv.Value != null)
                               .Select(kv => $"\"{kv.Key}\" : \"{kv.Value}\"");

            var documentMetadata = string.Join(",", paramStrings);

            sb.Append($"{{ \"index\" : {{ {documentMetadata} }} }}");
            sb.Append("\n");
        }