Skip to content

Specify usage of upsert key in Bulk operations - #11506

Merged
natebower merged 12 commits into
opensearch-project:mainfrom
karenyrx:patch-2
Nov 20, 2025
Merged

Specify usage of upsert key in Bulk operations#11506
natebower merged 12 commits into
opensearch-project:mainfrom
karenyrx:patch-2

Conversation

@karenyrx

@karenyrx karenyrx commented Nov 9, 2025

Copy link
Copy Markdown
Contributor

Description

The upsert key is supported in the spec for update operations: https://github.com/opensearch-project/opensearch-api-specification/blob/main/spec/schemas/_core.bulk.yaml#L121 , yet is not mentioned in the documentation anywhere.

Specify its usage in the documentation as well.

Issues Resolved

General fix

Version

All

Frontend features

If you're submitting documentation for an OpenSearch Dashboards feature, add a video that shows how a user will interact with the UI step by step. A voiceover is optional.

Checklist

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the Developers Certificate of Origin.
    For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Karen X <karenxyr@gmail.com>
@github-actions

github-actions Bot commented Nov 9, 2025

Copy link
Copy Markdown

Thank you for submitting your PR. The PR states are In progress (or Draft) -> Tech review -> Doc review -> Editorial review -> Merged.

Before you submit your PR for doc review, make sure the content is technically accurate. If you need help finding a tech reviewer, tag a maintainer.

When you're ready for doc review, tag the assignee of this PR. The doc reviewer may push edits to the PR directly or leave comments and editorial suggestions for you to address (let us know in a comment if you have a preference). The doc reviewer will arrange for an editorial review.

Signed-off-by: Karen X <karenxyr@gmail.com>
Signed-off-by: Karen X <karenxyr@gmail.com>
Signed-off-by: Karen X <karenxyr@gmail.com>
Signed-off-by: Karen X <karenxyr@gmail.com>
Signed-off-by: Karen X <karenxyr@gmail.com>
@kolchfa-aws kolchfa-aws added In progress Issue/PR: The issue or PR is in progress. backport 3.3 labels Nov 10, 2025
@karenyrx
karenyrx marked this pull request as ready for review November 10, 2025 22:10
@karenyrx

Copy link
Copy Markdown
Contributor Author

hi @kolchfa-aws would you be able to hep take a look at this PR? Thanks!

Signed-off-by: Karen X <karenxyr@gmail.com>

@kolchfa-aws kolchfa-aws left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @karenyrx! Please see my comments and let me know if you have any questions.

Comment thread _api-reference/document-apis/bulk.md Outdated
Comment thread _api-reference/document-apis/bulk.md Outdated
Comment thread _api-reference/document-apis/bulk.md Outdated
Comment thread _api-reference/document-apis/bulk.md Outdated
Comment thread _api-reference/document-apis/bulk.md Outdated
Comment thread _api-reference/document-apis/bulk.md Outdated
Comment thread _api-reference/document-apis/bulk.md Outdated
Comment thread _api-reference/document-apis/bulk.md Outdated
Comment thread _api-reference/document-apis/bulk.md Outdated
Comment thread _api-reference/document-apis/bulk.md Outdated
@kolchfa-aws kolchfa-aws added Doc review PR: Doc review in progress and removed In progress Issue/PR: The issue or PR is in progress. labels Nov 19, 2025
karenyrx and others added 3 commits November 19, 2025 16:45
Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>
Signed-off-by: Karen X <karenxyr@gmail.com>
Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>
Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>
@kolchfa-aws kolchfa-aws added Editorial review and removed Doc review PR: Doc review in progress labels Nov 20, 2025
Comment thread _api-reference/document-apis/bulk.md Outdated
Signed-off-by: Nathan Bower <nbower@amazon.com>

@natebower natebower left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@natebower
natebower merged commit fc5976c into opensearch-project:main Nov 20, 2025
6 checks passed
opensearch-trigger-bot Bot pushed a commit that referenced this pull request Nov 20, 2025
* Specify usage of `upsert` key in Bulk operations

Signed-off-by: Karen X <karenxyr@gmail.com>

* update

Signed-off-by: Karen X <karenxyr@gmail.com>

* update 2

Signed-off-by: Karen X <karenxyr@gmail.com>

* Update bulk.md

Signed-off-by: Karen X <karenxyr@gmail.com>

* update scripted upsert too

Signed-off-by: Karen X <karenxyr@gmail.com>

* update scripted upsert

Signed-off-by: Karen X <karenxyr@gmail.com>

* doc_as_upsert

Signed-off-by: Karen X <karenxyr@gmail.com>

* Apply suggestions from code review

Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>
Signed-off-by: Karen X <karenxyr@gmail.com>

* Tab over code samples so numbered list shows correct numbers

Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>

* Tab over code examples in the upsert section

Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>

* Update _api-reference/document-apis/bulk.md

Signed-off-by: Nathan Bower <nbower@amazon.com>

---------

Signed-off-by: Karen X <karenxyr@gmail.com>
Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>
Signed-off-by: Nathan Bower <nbower@amazon.com>
Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>
Co-authored-by: Nathan Bower <nbower@amazon.com>
(cherry picked from commit fc5976c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
{ "update": { "_index": "movies", "_id": "tt0816711" } }
{ "doc" : { "title": "World War Z" }, "doc_as_upsert": true }
```
1. Specify the document to update (when it exists) in the `doc` field, the document to insert (when it doesn't exist) in the `upsert` field, and leave `doc_as_update` set to `false`:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc_as_update does not exist. Fixed in #12865

kolchfa-aws pushed a commit that referenced this pull request Jul 28, 2026
…ant (#12865)

doc_as_update is not used by neither OpenSearch [1] nor Elastic [2].

[1]: https://github.com/search?q=org%3Aopensearch-project%20doc_as_update&type=code
[2]: https://github.com/search?q=repo%3Aelastic%2Fecs%20doc_as_update&type=code

Introduced in: #11506
Introduced in: fc5976c

Signed-off-by: Robin Schneider <ro.schneider@senec.com>
kolchfa-aws pushed a commit that referenced this pull request Jul 28, 2026
…ant (#12865) (#12867)

doc_as_update is not used by neither OpenSearch [1] nor Elastic [2].

[1]: https://github.com/search?q=org%3Aopensearch-project%20doc_as_update&type=code
[2]: https://github.com/search?q=repo%3Aelastic%2Fecs%20doc_as_update&type=code

Introduced in: #11506
Introduced in: fc5976c


(cherry picked from commit 9f78096)

Signed-off-by: Robin Schneider <ro.schneider@senec.com>
Signed-off-by: opensearch-ci-bot <opensearch-infra@amazon.com>
Co-authored-by: Robin Schneider <ro.schneider@senec.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants