@@ -273,6 +273,47 @@ Right (Tweet {user = "bitemyapp"
273273
274274#+END_SRC
275275
276+** Bulk Operations
277+
278+*** Bulk create, index
279+
280+#+BEGIN_SRC haskell
281+
282+-- don't forget the imports and derive generic setting for ghci
283+-- at the beginning of the examples.
284+
285+:{
286+-- Using the earlier Tweet datatype and exampleTweet data
287+
288+-- just changing up the data a bit.
289+let bulkTest = exampleTweet { user = "blah" }
290+let bulkTestTwo = exampleTweet { message = "woohoo!" }
291+
292+-- create only bulk operation
293+-- BulkCreate :: IndexName -> MappingName -> DocId -> Value -> BulkOperation
294+let firstOp = BulkCreate testIndex
295+ testMapping (DocId "3") (toJSON bulkTest)
296+
297+-- index operation "create or update"
298+let sndOp = BulkIndex testIndex
299+ testMapping (DocId "4") (toJSON bulkTestTwo)
300+
301+-- Some explanation, the final "Value" type that BulkIndex,
302+-- BulkCreate, and BulkUpdate accept is the actual document
303+-- data that your operation applies to. BulkDelete doesn't
304+-- take a value because it's just deleting whatever DocId
305+-- you pass.
306+
307+-- list of bulk operations
308+let stream = [firstDoc, secondDoc]
309+
310+-- Fire off the actual bulk request
311+-- bulk :: Server -> [BulkOperation] -> IO Reply
312+resp <- bulk testServer stream
313+:}
314+
315+#+END_SRC
316+
276317** Search
277318
278319*** Querying