Class 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 Detail

      • RankProfileRegistry

        public RankProfileRegistry()
    • Method Detail

      • createRankProfileRegistryWithBuiltinRankProfiles

        public static RankProfileRegistry createRankProfileRegistryWithBuiltinRankProfiles​(Schema schema)
      • add

        public void add​(RankProfile rankProfile)
        Adds a rank profile to this registry
        Parameters:
        rankProfile - the rank profile to add
      • 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.
      • rankProfilesOf

        public Collection<RankProfile> rankProfilesOf​(String search)
        Returns the rank profiles of a given search definition.
        Parameters:
        search - the searchdefinition to get rank profiles for
        Returns:
        a collection of RankProfile instances
      • rankProfilesOf

        public Collection<RankProfile> rankProfilesOf​(ImmutableSchema search)
        Retrieve all rank profiles for a search definition
        Parameters:
        search - search definition to fetch rank profiles for, or null for the global ones
        Returns:
        Collection of RankProfiles