Skip to content

Commit

Permalink
Fix: bulk response _source. (opensearch-project#375)
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock authored Jul 4, 2024
1 parent 25521f1 commit a359a5a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fixed `/_cat/cluster_manager`, `/_cat/allocation`, `/_cat/shards`, and `/_cat/thread_pool` ([#373](https://github.com/opensearch-project/opensearch-api-specification/pull/373))
- Fixed optional field in `/_nodes` ([#365](https://github.com/opensearch-project/opensearch-api-specification/pull/365))
- Fixed `/{index}/_open` can return a `task` ([#376](https://github.com/opensearch-project/opensearch-api-specification/pull/376))

- Fixed `_source` in `bulk` responses ([#375](https://github.com/opensearch-project/opensearch-api-specification/pull/375))

### Security

[Unreleased]: https://github.com/opensearch-project/opensearch-api-specification/commits/main/
5 changes: 1 addition & 4 deletions spec/schemas/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -671,11 +671,9 @@ components:
$ref: '#/components/schemas/Routing'
_source:
type: object
additionalProperties:
type: object
additionalProperties: true
required:
- found
- _source
Names:
oneOf:
- $ref: '#/components/schemas/Name'
Expand Down Expand Up @@ -1256,7 +1254,6 @@ components:
type: object
required:
- found
- _source
IndexAlias:
type: string
ErrorResponseBase:
Expand Down
23 changes: 14 additions & 9 deletions tests/_core/bulk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,23 @@ chapters:
request_body:
content_type: application/x-ndjson
payload:
- {create: {_index: movies}}
- {director: Bennett Miller, title: Moneyball, year: 2011}
- { create: { _index: movies } }

Check failure on line 15 in tests/_core/bulk.yaml

View workflow job for this annotation

GitHub Actions / test

There should be no space after '{'

Check failure on line 15 in tests/_core/bulk.yaml

View workflow job for this annotation

GitHub Actions / test

There should be no space after '{'

Check failure on line 15 in tests/_core/bulk.yaml

View workflow job for this annotation

GitHub Actions / test

There should be no space before '}'

Check failure on line 15 in tests/_core/bulk.yaml

View workflow job for this annotation

GitHub Actions / test

There should be no space before '}'
- { director: Bennett Miller, title: Moneyball, year: 2011 }

Check failure on line 16 in tests/_core/bulk.yaml

View workflow job for this annotation

GitHub Actions / test

There should be no space after '{'

Check failure on line 16 in tests/_core/bulk.yaml

View workflow job for this annotation

GitHub Actions / test

There should be no space before '}'
- synopsis: Bulk document CRUD.
path: /_bulk
method: POST
request_body:
content_type: application/x-ndjson
payload:
- {create: {_index: books, _id: book_1392214}}
- {author: Harper Lee, title: To Kill a Mockingbird, year: 1960}
- {update: {_index: books, _id: book_1392214}}
- {doc: {pages: 376}}
- {update: {_index: books, _id: book_1392214}}
- {script: {source: 'ctx._source.pages = 376;'}}
- {delete: {_index: books, _id: book_1392214}}
- { create: { _index: books, _id: book_1392214 } }

Check failure on line 23 in tests/_core/bulk.yaml

View workflow job for this annotation

GitHub Actions / test

There should be no space after '{'

Check failure on line 23 in tests/_core/bulk.yaml

View workflow job for this annotation

GitHub Actions / test

There should be no space after '{'

Check failure on line 23 in tests/_core/bulk.yaml

View workflow job for this annotation

GitHub Actions / test

There should be no space before '}'

Check failure on line 23 in tests/_core/bulk.yaml

View workflow job for this annotation

GitHub Actions / test

There should be no space before '}'
- { author: Harper Lee, title: To Kill a Mockingbird, year: 1960 }
- { update: { _index: books, _id: book_1392214 } }
- { doc: { pages: 376 } }
- { update: { _index: books, _id: book_1392214 } }
- { doc: { pages: 376 }, _source: true }
- { update: { _index: books, _id: book_1392214 } }
- { script: { source: 'ctx._source.pages = 376;' } }
- { update: { _index: books, _id: does_not_exist } }
- { script: { source: 'ctx.op = "none";' }, scripted_upsert: true, upsert: { pages: 375 } }
- { delete: { _index: books, _id: book_1392214 } }

0 comments on commit a359a5a

Please sign in to comment.