@@ -80,7 +80,7 @@ public class SimpleElasticsearchPersistentEntity<T> extends BasicPersistentEntit
80
80
private @ Nullable VersionType versionType ;
81
81
private boolean createIndexAndMapping ;
82
82
private final Map <String , ElasticsearchPersistentProperty > fieldNamePropertyCache = new ConcurrentHashMap <>();
83
- private final ConcurrentHashMap <String , Expression > templateExpressions = new ConcurrentHashMap <>();
83
+ private final ConcurrentHashMap <String , Expression > routingExpressions = new ConcurrentHashMap <>();
84
84
private @ Nullable String routing ;
85
85
86
86
private final ConcurrentHashMap <String , Expression > indexNameExpressions = new ConcurrentHashMap <>();
@@ -111,10 +111,11 @@ public SimpleElasticsearchPersistentEntity(TypeInformation<T> typeInformation) {
111
111
this .routing = document .routing ();
112
112
}
113
113
114
- Setting setting = AnnotatedElementUtils .getMergedAnnotation (clazz , Setting .class );
114
+ Setting setting = AnnotatedElementUtils .getMergedAnnotation (clazz , Setting .class );
115
115
116
- if (setting != null ) {
117
- this .settingPath = setting .settingPath ();
116
+ if (setting != null ) {
117
+ this .settingPath = setting .settingPath ();
118
+ }
118
119
}
119
120
}
120
121
@@ -183,6 +184,7 @@ public String settingPath() {
183
184
public boolean isCreateIndexAndMapping () {
184
185
return createIndexAndMapping ;
185
186
}
187
+
186
188
@ Override
187
189
public boolean hasScoreProperty () {
188
190
return scoreProperty != null ;
@@ -194,7 +196,6 @@ public ElasticsearchPersistentProperty getScoreProperty() {
194
196
return scoreProperty ;
195
197
}
196
198
197
-
198
199
@ Override
199
200
@ Nullable
200
201
public String getRouting () {
@@ -366,7 +367,8 @@ private String resolve(String name) {
366
367
367
368
Expression expression = getExpressionForIndexName (name );
368
369
369
- String resolvedName = expression != null ? expression .getValue (indexNameEvaluationContext .get (), String .class ) : null ;
370
+ String resolvedName = expression != null ? expression .getValue (indexNameEvaluationContext .get (), String .class )
371
+ : null ;
370
372
return resolvedName != null ? resolvedName : name ;
371
373
}
372
374
@@ -400,13 +402,12 @@ private EvaluationContext getIndexNameEvaluationContext() {
400
402
return getEvaluationContext (null , expressionDependencies );
401
403
}
402
404
403
-
404
405
@ Override
405
406
public String resolveRouting (Object bean ) {
406
407
String resolved = null ;
407
408
408
409
if (hasRouting ()) {
409
- Expression expression = expressions .computeIfAbsent (getRouting (), PARSER ::parseExpression );
410
+ Expression expression = routingExpressions .computeIfAbsent (getRouting (), PARSER ::parseExpression );
410
411
411
412
try {
412
413
EvaluationContext context = getEvaluationContext (bean );
0 commit comments