opensearch-project / opensearch-project/opensearch-java
[FEATURE] Support for Dynamic Template Variables
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 165
- Forks
- 250
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 26
Description
Is your feature request related to a problem?
OpenSearch supports usage of Dynamic Template Variables (for e.g., {dynamic_type}), but the opensearch-java client does not have an option for it in this Property class: https://github.com/opensearch-project/opensearch-java/blob/v2.4.0/java-client/src/main/java/org/opensearch/client/opensearch/_types/mapping/Property.java.
For example, I would like to add a template variable in this dynamic template like so:
{
"mappings": {
"dynamic_templates": [
{
"strict_mappings": {
"mapping": {
"type": "{dynamic_type}",
"dynamic":"strict"
},
"match":"*"
}
}
]
}
}
What solution would you like?
Add support for template variables, so they can be used when creating dynamic templates.
What alternatives have you considered?
In my specific case, I can use "dynamic" : "strict" on the root object to not allow adding any new dynamic fields. So, the alternatives can vary based on your specific circumstance.
Do you have any additional context?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting java-client/src/main/java/org/opensearch/client/opensearch/_types/mapping/Property.java at the referenced v2.4.0 location, then trace how dynamic templates and mapping properties are represented. Compare the current model with the example using {dynamic_type}; done means dynamic template creation can express that variable and the client serializes it correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100