diff options
Diffstat (limited to 'container-search')
-rw-r--r-- | container-search/abi-spec.json | 1 | ||||
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileTypeRegistry.java | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/container-search/abi-spec.json b/container-search/abi-spec.json index 80038da6750..38ce2aa2cf2 100644 --- a/container-search/abi-spec.json +++ b/container-search/abi-spec.json @@ -6177,6 +6177,7 @@ "methods": [ "public void <init>()", "public void register(com.yahoo.search.query.profile.types.QueryProfileType)", + "public boolean hasApplicationTypes()", "public void freeze()", "public static com.yahoo.search.query.profile.types.QueryProfileTypeRegistry emptyFrozen()" ], diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileTypeRegistry.java b/container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileTypeRegistry.java index ff8c4845845..b76ae88ede1 100644 --- a/container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileTypeRegistry.java +++ b/container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileTypeRegistry.java @@ -12,8 +12,11 @@ import com.yahoo.search.query.profile.QueryProfileRegistry; */ public class QueryProfileTypeRegistry extends ComponentRegistry<QueryProfileType> { + private final int nativeProfileCount; + public QueryProfileTypeRegistry() { Query.addNativeQueryProfileTypesTo(this); + nativeProfileCount = allComponents().size(); } /** Register this type by its id */ @@ -21,6 +24,11 @@ public class QueryProfileTypeRegistry extends ComponentRegistry<QueryProfileType super.register(type.getId(), type); } + /** Returns true if this has types in addition to the native Vespa types */ + public boolean hasApplicationTypes() { + return allComponents().size() > nativeProfileCount; + } + @Override public void freeze() { if (isFrozen()) return; |