aboutsummaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-09-04 10:55:19 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2021-09-04 17:41:33 +0200
commit5cc49f38df281cb3ee21a0a19694512378921cf5 (patch)
tree4ad3faa8e317e3f1934bb17d8ac8031b26c9a7c3 /config-model
parent2fcfba1b81c30b6c9407550045cce15c8dd60adb (diff)
Handle that inherited rank-profile might not be registered yet.
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java
index ba448f9a9f1..79f56e3f76e 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java
@@ -64,6 +64,7 @@ public class RankProfile implements Cloneable {
private final VespaModel model;
/** The name of the rank profile inherited by this */
+ private String inheritedName = null;
private RankProfile inherited = null;
/** The match settings of this profile */
@@ -191,14 +192,19 @@ public class RankProfile implements Cloneable {
* definition
*/
public void setInherited(String inheritedName) {
+ this.inheritedName = inheritedName;
inherited = resolveInherited(inheritedName);
}
/** Returns the name of the profile this one inherits, or null if none is inherited */
- public String getInheritedName() { return inherited != null ? inherited.getName() : null; }
+ public String getInheritedName() { return inheritedName; }
/** Returns the inherited rank profile, or null if there is none */
public RankProfile getInherited() {
+ if (inherited != null) return inherited;
+ if (inheritedName != null) {
+ inherited = resolveInherited(inheritedName);
+ }
return inherited;
}