aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/searchdefinition/RankProfileRegistry.java
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition/RankProfileRegistry.java')
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/RankProfileRegistry.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfileRegistry.java b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfileRegistry.java
index 7b4d70d85b1..a075b9d00fa 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfileRegistry.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfileRegistry.java
@@ -16,7 +16,8 @@ import java.util.Set;
* Having both of these mappings consolidated here make it easier to remove dependencies on these mappings at
* run time, since it is essentially only used when building rank profile config at deployment time.
*
- * TODO: Rank profiles should be stored under its owning Search instance.
+ * TODO: Reconsider the difference between local and global maps. Right now, the local maps might better be
+ * served from a different class owned by SearchBuilder.
*
* @author Ulf Lilleengen
*/
@@ -30,6 +31,9 @@ public class RankProfileRegistry {
/* These rank profiles can be overridden: 'default' rank profile, as that is documented to work. And 'unranked'. */
static final Set<String> overridableRankProfileNames = new HashSet<>(Arrays.asList("default", "unranked"));
+ public RankProfileRegistry() {
+ }
+
public static RankProfileRegistry createRankProfileRegistryWithBuiltinRankProfiles(Search search) {
RankProfileRegistry rankProfileRegistry = new RankProfileRegistry();
rankProfileRegistry.addRankProfile(new DefaultRankProfile(search, rankProfileRegistry));
@@ -43,7 +47,7 @@ public class RankProfileRegistry {
* @param rankProfile the rank profile to add
*/
public void addRankProfile(RankProfile rankProfile) {
- if ( ! rankProfiles.containsKey(rankProfile.getSearch())) {
+ if (!rankProfiles.containsKey(rankProfile.getSearch())) {
rankProfiles.put(rankProfile.getSearch(), new LinkedHashMap<>());
}
checkForDuplicateRankProfile(rankProfile);