Package com.yahoo.searchdefinition
Class RankProfileRegistry
- java.lang.Object
-
- com.yahoo.searchdefinition.RankProfileRegistry
-
public class RankProfileRegistry extends Object
Mapping from name toRankProfile
as well as a reverse mapping ofRankProfile
toSchema
. 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 registryCollection<RankProfile>
all()
Rank profiles that are collected across clusters.static RankProfileRegistry
createRankProfileRegistryWithBuiltinRankProfiles(Schema schema)
RankProfile
get(ImmutableSchema schema, String name)
RankProfile
get(String schema, String name)
Returns a named rank profile, null if the search definition doesn't have one with the given nameRankProfile
getGlobal(String name)
Collection<RankProfile>
rankProfilesOf(ImmutableSchema schema)
Retrieve all rank profiles for a schemaRankProfile
resolve(SDDocumentType docType, String name)
-
-
-
Method Detail
-
createRankProfileRegistryWithBuiltinRankProfiles
public static RankProfileRegistry createRankProfileRegistryWithBuiltinRankProfiles(Schema schema)
-
add
public void add(RankProfile rankProfile)
Adds a rank profile to this registry
-
get
public RankProfile get(String schema, String name)
Returns a named rank profile, null if the search definition doesn't have one with the given name- Parameters:
schema
- theSchema
that owns the rank profilename
- the name of the rank profile- Returns:
- the RankProfile to return.
-
get
public RankProfile get(ImmutableSchema schema, String name)
-
getGlobal
public RankProfile getGlobal(String name)
-
resolve
public RankProfile resolve(SDDocumentType docType, String name)
-
all
public Collection<RankProfile> all()
Rank profiles that are collected across clusters.- Returns:
- a set of global
RankProfile
instances
-
rankProfilesOf
public Collection<RankProfile> rankProfilesOf(ImmutableSchema schema)
Retrieve all rank profiles for a schema- Parameters:
schema
- the schema to fetch rank profiles for, or null for the global ones- Returns:
- a collection of
RankProfile
instances
-
-