| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Elasticsearch.Bulk.Response
Contents
Description
Response to /_bulk request.
Types
Constructors
| Response | |
The action to be taken with the document.
The _type field is omitted because it is always _doc in Elasticsearch 7+. Some other fields are omitted because they are only present when an operation succeeds.
Constructors
| Item | |
data ConcurrencyControl Source #
Constructors
| ConcurrencyControl | |
Fields
| |
Instances
| Show ConcurrencyControl Source # | |
Defined in Elasticsearch.Bulk.Response Methods showsPrec :: Int -> ConcurrencyControl -> ShowS # show :: ConcurrencyControl -> String # showList :: [ConcurrencyControl] -> ShowS # | |
An item has different fields depending on whether the operation was considered to have succeeded.
Constructors
| Success !ConcurrencyControl | |
| Failure !Error |
Response Parser
Example Data
Example responses from Elasticsearch documentation with additional commentary. This one does not include any detailed error messages:
{
"took": 30,
"errors": false,
"items": [
{
"index": {
"_index": "test",
"_type": "_doc",
"_id": "1",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"status": 201,
"_seq_no" : 0,
"_primary_term": 1
}
},
{
"delete": {
"_index": "test",
"_type": "_doc",
"_id": "2",
"_version": 1,
"result": "not_found",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"status": 404,
"_seq_no" : 1,
"_primary_term" : 2
}
}
]
}This one does have detailed error messages in it:
{
"took": 486,
"errors": true,
"items": [
{
"update": {
"_index": "index1",
"_type" : "_doc",
"_id": "5",
"status": 404,
"error": {
"type": "document_missing_exception",
"reason": "[_doc][5]: document missing",
"index_uuid": "aAsFqTI0Tc2W0LCWgPNrOA",
"shard": "0",
"index": "index1"
}
}
},
{
"update": {
"_index": "index1",
"_type" : "_doc",
"_id": "6",
"status": 404,
"error": {
"type": "document_missing_exception",
"reason": "[_doc][6]: document missing",
"index_uuid": "aAsFqTI0Tc2W0LCWgPNrOA",
"shard": "0",
"index": "index1"
}
}
},
{
"create": {
"_index": "index1",
"_type" : "_doc",
"_id": "7",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"_seq_no": 0,
"_primary_term": 1,
"status": 201
}
}
]
}Even though the documentation shows an index_uuid field in the
error details, Elasticsearch 7.10 does not always populate this field.
It is not terribly useful, so it is omitted from the Error type.