@@ -273,6 +273,47 @@ Right (Tweet {user = "bitemyapp"
278+*** Bulk create, index
282+-- don't forget the imports and derive generic setting for ghci
283+-- at the beginning of the examples.
286+-- Using the earlier Tweet datatype and exampleTweet data
288+-- just changing up the data a bit.
289+let bulkTest = exampleTweet { user = "blah" }
290+let bulkTestTwo = exampleTweet { message = "woohoo!" }
292+-- create only bulk operation
293+-- BulkCreate :: IndexName -> MappingName -> DocId -> Value -> BulkOperation
294+let firstOp = BulkCreate testIndex
295+ testMapping (DocId "3") (toJSON bulkTest)
297+-- index operation "create or update"
298+let sndOp = BulkIndex testIndex
299+ testMapping (DocId "4") (toJSON bulkTestTwo)
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
307+-- list of bulk operations
308+let stream = [firstDoc, secondDoc]
310+-- Fire off the actual bulk request
311+-- bulk :: Server -> [BulkOperation] -> IO Reply
312+resp <- bulk testServer stream
278*** Querying
319*** Querying