add REST test for bulk api integration with ingest

This commit is contained in:
javanna 2016-01-11 19:04:34 +01:00 committed by Luca Cavanna
parent b4baa6c7ab
commit 90743d8db0
1 changed files with 105 additions and 0 deletions

View File

@ -0,0 +1,105 @@
setup:
- do:
ingest.put_pipeline:
id: "pipeline1"
body: >
{
"description": "_description",
"processors": [
{
"set" : {
"field" : "field1",
"value": "value1"
}
}
]
}
- do:
ingest.put_pipeline:
id: "pipeline2"
body: >
{
"description": "_description",
"processors": [
{
"set" : {
"field" : "field2",
"value": "value2"
}
}
]
}
---
"Test bulk request without default pipeline":
- do:
bulk:
body:
- index:
_index: test_index
_type: test_type
_id: test_id1
pipeline: pipeline1
- f1: v1
- index:
_index: test_index
_type: test_type
_id: test_id2
- f1: v2
- do:
get:
index: test_index
type: test_type
id: test_id1
- match: {_source.field1: value1}
- is_false: _source.field2
- do:
get:
index: test_index
type: test_type
id: test_id2
- is_false: _source.field1
- is_false: _source.field2
---
"Test bulk request with default pipeline":
- do:
bulk:
pipeline: pipeline1
body:
- index:
_index: test_index
_type: test_type
_id: test_id1
- f1: v1
- index:
_index: test_index
_type: test_type
_id: test_id2
pipeline: pipeline2
- f1: v2
- do:
get:
index: test_index
type: test_type
id: test_id1
- match: {_source.field1: value1}
- is_false: _source.field2
- do:
get:
index: test_index
type: test_type
id: test_id2
- is_false: _source.field1
- match: {_source.field2: value2}