opensearch-project / spring-data-opensearch

The Spring Data OpenSearch project provides Spring Data compatible integration with the OpenSearch search engine.
Apache License 2.0
118 stars 41 forks source link

[BUG] Dynamic mapping type "strict_allow_templates" does not exists for @Document Annotation. #357

Open Xyaren opened 1 month ago

Xyaren commented 1 month ago

What is the bug?

The feature was implemented in https://github.com/opensearch-project/OpenSearch/pull/14555. I can not use this option when generating the mapping using spring because the enum value does not exist:

@Document(indexName = "#{@environment.getProperty('opensearch.index.relations.name')}",
          versionType = Document.VersionType.INTERNAL,
          dynamic = Dynamic.STRICT_ALLOW_TEMPLATES,  // <--------- Here
          writeTypeHint = WriteTypeHint.FALSE)
@Setting(settingPath = "os/relation.settings.json")
@DynamicTemplates(mappingPath = "os/relation.dynamic-templates.json")
public class RelationDocument {

The same applies on a field basis:

@Field(type = FieldType.Object, dynamic = Dynamic.STRICT_ALLOW_TEMPLATES)
private LocalizedString localName;

What is the expected behavior?

I can select the option.

dblock commented 3 weeks ago

[Catch All Triage - 1, 2]