/* * public string IndexBulk(BulkCommand bulkCommand, IEnumerable<ESDocument> documents = null) * { * string data = Serializer.ToJson(documents); * * string command = "index"; * string index = bulkCommand.Index; * string typeName = bulkCommand.Type; * * var sb = new StringBuilder(); * var action = String.Format("{{ \"{0}\" : {{ \"_index\" : \"{1}\", \"_type\" : \"{2}\"", command, index, typeName); * * foreach (var document in documents) * { * var objectAction = action; * objectAction += String.Format(", \"_id\" : \"{0}\" ", document["__key"]); * * objectAction += "} }\n"; * * sb.Append(objectAction); * if (command == "index") * { * string jsonCommand = Serializer.ToJson(document); * sb.Append(jsonCommand + "\n"); * } * } * var json = sb.ToString(); * * var result = connection.Put(bulkCommand, json); * return result; * //return Serializer.ToIndexResult(result); * } * */ public DeleteResult Delete(DeleteCommand deleteCommand) { var result = connection.Delete(deleteCommand); return(Serializer.ToDeleteResult(result)); }