forked from opensearch-project/opensearch-api-specification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bulk.yaml
57 lines (55 loc) · 1.58 KB
/
bulk.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
$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}}