@@ -885,6 +885,12 @@ encodeBulkOperation (BulkUpdate (IndexName indexName)
885 doc = object ["doc" .= value]
885 doc = object ["doc" .= value]
886 blob = encode metadata `mappend` "\n" `mappend` encode doc
886 blob = encode metadata `mappend` "\n" `mappend` encode doc
888+encodeBulkOperation (BulkCreateEncoding (IndexName indexName)
889+ (MappingName mappingName)
890+ (DocId docId) encoding) = toLazyByteString blob
891+ where metadata = toEncoding (mkBulkStreamValue "create" indexName mappingName docId)
892+ blob = fromEncoding metadata <> "\n" <> fromEncoding encoding
888-- | 'getDocument' is a straight-forward way to fetch a single document from
894-- | 'getDocument' is a straight-forward way to fetch a single document from
889-- Elasticsearch using a 'Server', 'IndexName', 'MappingName', and a 'DocId'.
895-- Elasticsearch using a 'Server', 'IndexName', 'MappingName', and a 'DocId'.
890-- The 'DocId' is the primary key for your Elasticsearch document.
896-- The 'DocId' is the primary key for your Elasticsearch document.