Class RankProfileRegistry

java.lang.Object
com.yahoo.schema.RankProfileRegistry

public class RankProfileRegistry extends Object
Mapping from name to RankProfile as well as a reverse mapping of RankProfile to Schema. 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 Details

    • RankProfileRegistry

      public RankProfileRegistry()
  • Method Details

    • 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 - the Schema that owns the rank profile
      name - 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