[Backport 3.x] [Guide] Add document lifecycle guide#2021
Merged
Conversation
* Make document lifecycle guidance verifiable for Java users Constraint: Issue opensearch-project#431 asks for a Java document lifecycle guide similar to the Ruby guide while matching existing Java guide conventions. Rejected: Guide-only snippets | A runnable sample keeps the documented examples compileable and Docker-verified. Rejected: Repository-order CI workaround in this PR | It fixed a transient upstream Maven 503 but widened the guide-focused review scope. Confidence: high Scope-risk: narrow Directive: Keep guide snippets aligned with DocumentLifecycle when changing lifecycle examples. Tested: git diff --check Tested: ./gradlew :samples:compileJava :samples:spotlessJavaCheck Tested: Docker Compose OpenSearch 3.2.0 health green; PASSWORD=0_aD^min_0 ./gradlew :samples:run -Dsamples.mainClass=DocumentLifecycle Not-tested: Full repository test suite Signed-off-by: sanghun <vitash1215@gmail.com> * Align document lifecycle guide with review wording Constraint: Maintainer review requested wording, heading, and setup-style adjustments in guides/document_lifecycle.md. Rejected: Changing the runnable sample | The review feedback targeted guide phrasing, and the sample still compiles unchanged. Confidence: high Scope-risk: narrow Directive: Keep the guide TOC anchors synchronized with section heading changes. Tested: git diff --check Tested: ./gradlew :samples:compileJava :samples:spotlessJavaCheck Not-tested: Full repository test suite Signed-off-by: sanghun <vitash1215@gmail.com> * Align document lifecycle sample setup with guide Constraint: Maintainer review requested DocumentLifecycle.java to match the setup snippet already applied in guides/document_lifecycle.md. Rejected: Reintroducing SampleClient.create | The review suggestion asks for the explicit HttpHost transport setup. Confidence: high Scope-risk: narrow Directive: Keep sample setup aligned with guide setup code. Tested: git diff --check Tested: ./gradlew :samples:compileJava :samples:spotlessJavaCheck Tested: OPENSEARCH_VERSION=3.2.0 SECURE_INTEGRATION=false docker compose --project-directory .ci/opensearch up -d --build; ./gradlew :samples:run -Dsamples.mainClass=DocumentLifecycle; docker compose down Not-tested: Full repository test suite Signed-off-by: sanghun <vitash1215@gmail.com> --------- Signed-off-by: sanghun <vitash1215@gmail.com> (cherry picked from commit 354ff2e) Signed-off-by: sanghun <vitash1215@gmail.com>
Signed-off-by: Andriy Redko <drreta@gmail.com>
reta
reviewed
Jun 26, 2026
| private static final String REINDEXED_INDEX_NAME = "movies-document-lifecycle-reindexed"; | ||
|
|
||
| public static void main(String[] args) throws Exception { | ||
| OpenSearchClient client = SampleClient.create(); |
Collaborator
There was a problem hiding this comment.
@lsh1215 my apologies, but I confused you (and myself), the samples do use SampleClient.create() consistently, I updated this one. Thank you.
reta
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport 354ff2e from #2017 to the 3.x branch.
This PR was opened because the automatic backport to
3.xfailed due to aCHANGELOG.mdconflict.Changes:
DocumentLifecyclesample.Unreleased 3.x.Validation:
./gradlew :samples:compileJavaThe compile check completed successfully. The output included existing deprecation/unchecked warnings in sample sources, but the Gradle build finished with
BUILD SUCCESSFUL.