diff --git a/tests/default/_core/bulk.yaml b/tests/default/_core/bulk.yaml index 3ed17252..37104b2b 100644 --- a/tests/default/_core/bulk.yaml +++ b/tests/default/_core/bulk.yaml @@ -14,6 +14,23 @@ chapters: payload: - {create: {_index: movies}} - {director: Bennett Miller, title: Moneyball, year: 2011} + - synopsis: Delete document in an index. + path: /_bulk + method: PUT + request: + content_type: application/x-ndjson + payload: + - {delete: {_index: movies, _id: invalid}} + response: + status: 200 + payload: + errors: false + items: + - delete: + _index: movies + _id: invalid + result: not_found + status: 404 - synopsis: Bulk document CRUD. path: /_bulk method: POST diff --git a/tests/default/indices/bulk.yaml b/tests/default/indices/bulk.yaml new file mode 100644 index 00000000..fda3b755 --- /dev/null +++ b/tests/default/indices/bulk.yaml @@ -0,0 +1,57 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test bulk index endpoint. +epilogues: + - path: /books,movies + method: DELETE + status: [200, 404] +chapters: + - synopsis: Create an index. + path: /{index}/_bulk + method: POST + parameters: + index: movies + request: + content_type: application/x-ndjson + payload: + - {create: {}} + - {director: Bennett Miller, title: Moneyball, year: 2011} + - synopsis: Delete document in an index. + path: /{index}/_bulk + method: PUT + parameters: + index: movies + request: + content_type: application/x-ndjson + payload: + - {delete: {_id: invalid}} + response: + status: 200 + payload: + errors: false + items: + - delete: + _index: movies + _id: invalid + result: not_found + status: 404 + - synopsis: Bulk index document CRUD. + method: POST + path: /{index}/_bulk + parameters: + index: books + request: + content_type: application/x-ndjson + payload: + - {create: {_id: book_1392214}} + - {author: Harper Lee, title: To Kill a Mockingbird, year: 1960} + - {update: {_id: book_1392214}} + - {doc: {pages: 376}} + - {update: {_id: book_1392214}} + - {doc: {pages: 376}, _source: true} + - {update: {_id: book_1392214}} + - {script: {source: ctx._source.pages = 376;}} + - {update: {_id: does_not_exist}} + - {script: {source: 'ctx.op = "none";'}, scripted_upsert: true, upsert: {pages: 375}} + - {delete: {_id: book_1392214}} +