From 90743d8db0d3b486590a4ac4f9a7346d8f68b685 Mon Sep 17 00:00:00 2001 From: javanna Date: Mon, 11 Jan 2016 19:04:34 +0100 Subject: [PATCH] add REST test for bulk api integration with ingest --- .../rest-api-spec/test/ingest/70_bulk.yaml | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 rest-api-spec/src/main/resources/rest-api-spec/test/ingest/70_bulk.yaml diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/ingest/70_bulk.yaml b/rest-api-spec/src/main/resources/rest-api-spec/test/ingest/70_bulk.yaml new file mode 100644 index 00000000000..b70f05af67e --- /dev/null +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/ingest/70_bulk.yaml @@ -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} +