opensearch-project / opensearch-project/opensearch-java

[BUG] Inconsistent priority field type between PutIndexTemplateRequest and IndexTemplate models

Open
#1,702 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
165
Forks
250
Avg merge
1d 18h
Merged PRs (30d)
26

Description

Hi,

I have observed a type inconsistency in the Java client related to the priority field when working with index templates. I am using the 2.9.0 client version, and I see the issue is still present in the latest version.

Details:

  • PutIndexTemplateRequest (org.opensearch.client.opensearch.indices.PutIndexTemplateRequest): the priority field is of type Integer
  • IndexTemplate (org.opensearch.client.opensearch.indices.get_index_template.IndexTemplate): The priority field is of type Long

Issue:

OpenSearch itself supports a 64-bit integer (int64) for the index template priority, but the Java client's PutIndexTemplateRequest only allows an Integer. This mismatch does not allow creating index templates with values above Integer.MAX_VALUE using the Java client.

Expected Behavior:
Both PutIndexTemplateRequest and IndexTemplate should use Long for the priority field to align with OpenSearch's API.

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the priority declarations in java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutIndexTemplateRequest.java and java-client/src/generated/java/org/opensearch/client/opensearch/indices/get_index_template/IndexTemplate.java. Confirm that both represent the OpenSearch int64 priority consistently and that the request can accept values above Integer.MAX_VALUE; the issue is done when the client types align.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.