Skip to content

Support for DynamicTemplates. #2969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Polishing.
Signed-off-by: Youssef Aouichaoui <[email protected]>
  • Loading branch information
youssef3wi committed Sep 6, 2024
commit e38fbb3763a3aec300e8833bbef0735a35d20c16
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ private void refreshEntitiesMapping() {
ClusterMapping clusterMapping = getClusterMapping();
for (ClusterMapping.ClusterMappingEntry mappingEntry : clusterMapping) {
// Get entity
Class<?> entity = null;
ElasticsearchPersistentEntity<?> entity = null;
for (ElasticsearchPersistentEntity<?> persistentEntity : this.elasticsearchConverter.getMappingContext().getPersistentEntities()) {
if (mappingEntry.getName().equals(persistentEntity.getIndexCoordinates().getIndexName())) {
entity = persistentEntity.getType();
entity = persistentEntity;

break;
}
Expand All @@ -281,7 +281,7 @@ private void refreshEntitiesMapping() {
if (mappingEntry.getMappings().containsKey("dynamic_templates")) {
Object dynamicTemplates = mappingEntry.getMappings().get("dynamic_templates");
if (dynamicTemplates instanceof List<?> value) {
getRequiredPersistentEntity(entity).buildDynamicTemplates(value);
entity.buildDynamicTemplates(value);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ private static class FieldAliasEntity {
}

@SuppressWarnings("unused")
@Document(indexName = "foo")
@Document(indexName = "#{@indexNameProvider.indexName()}-foo")
@DynamicTemplates(mappingPath = "/mappings/test-dynamic_templates_mappings_three.json")
private static class DynamicFieldDocument {
@Nullable
Expand Down