mirror of
https://github.com/typeable/bloodhound.git
synced 2024-09-11 08:25:32 +03:00
bulk create encoding
This commit is contained in:
parent
e34d30285b
commit
087ecbc7ab
@ -885,6 +885,12 @@ encodeBulkOperation (BulkUpdate (IndexName indexName)
|
||||
doc = object ["doc" .= value]
|
||||
blob = encode metadata `mappend` "\n" `mappend` encode doc
|
||||
|
||||
encodeBulkOperation (BulkCreateEncoding (IndexName indexName)
|
||||
(MappingName mappingName)
|
||||
(DocId docId) encoding) = toLazyByteString blob
|
||||
where metadata = toEncoding (mkBulkStreamValue "create" indexName mappingName docId)
|
||||
blob = fromEncoding metadata <> "\n" <> fromEncoding encoding
|
||||
|
||||
-- | 'getDocument' is a straight-forward way to fetch a single document from
|
||||
-- Elasticsearch using a 'Server', 'IndexName', 'MappingName', and a 'DocId'.
|
||||
-- The 'DocId' is the primary key for your Elasticsearch document.
|
||||
|
@ -710,8 +710,9 @@ data Mapping = Mapping { typeName :: TypeName
|
||||
data BulkOperation =
|
||||
BulkIndex IndexName MappingName DocId Value
|
||||
| BulkCreate IndexName MappingName DocId Value
|
||||
| BulkCreateEncoding IndexName MappingName DocId Encoding
|
||||
| BulkDelete IndexName MappingName DocId
|
||||
| BulkUpdate IndexName MappingName DocId Value deriving (Eq, Read, Show, Generic, Typeable)
|
||||
| BulkUpdate IndexName MappingName DocId Value deriving (Eq, Show, Generic, Typeable)
|
||||
|
||||
{-| 'EsResult' describes the standard wrapper JSON document that you see in
|
||||
successful Elasticsearch lookups or lookups that couldn't find the document.
|
||||
|
Loading…
Reference in New Issue
Block a user