Package com.yahoo.searchdefinition
Class RankProfileRegistry
- java.lang.Object
-
- com.yahoo.searchdefinition.RankProfileRegistry
-
public class RankProfileRegistry extends java.lang.Object
Mapping from name toRankProfile
as well as a reverse mapping ofRankProfile
toSearch
. 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. Global rank profiles are represented by the Search key null.- Author:
- Ulf Lilleengen
-
-
Constructor Summary
Constructors Constructor Description RankProfileRegistry()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(RankProfile rankProfile)
Adds a rank profile to this registryjava.util.Set<RankProfile>
all()
Rank profiles that are collected across clusters.static RankProfileRegistry
createRankProfileRegistryWithBuiltinRankProfiles(Search search)
RankProfile
get(ImmutableSearch search, java.lang.String name)
Returns a named rank profile, null if the search definition doesn't have one with the given namejava.util.Collection<RankProfile>
rankProfilesOf(ImmutableSearch search)
Returns the rank profiles of a given search definition.
-
-
-
Method Detail
-
createRankProfileRegistryWithBuiltinRankProfiles
public static RankProfileRegistry createRankProfileRegistryWithBuiltinRankProfiles(Search search)
-
add
public void add(RankProfile rankProfile)
Adds a rank profile to this registry- Parameters:
rankProfile
- the rank profile to add
-
get
public RankProfile get(ImmutableSearch search, java.lang.String name)
Returns a named rank profile, null if the search definition doesn't have one with the given name- Parameters:
search
- theSearch
that owns the rank profile.name
- the name of the rank profile- Returns:
- the RankProfile to return.
-
all
public java.util.Set<RankProfile> all()
Rank profiles that are collected across clusters.- Returns:
- A set of global
RankProfile
instances.
-
rankProfilesOf
public java.util.Collection<RankProfile> rankProfilesOf(ImmutableSearch search)
Returns the rank profiles of a given search definition.- Parameters:
search
-Search
to get rank profiles for- Returns:
- a collection of
RankProfile
instances
-
-