Class RankProfileRegistry


  • public class RankProfileRegistry
    extends java.lang.Object
    Mapping from name to RankProfile as well as a reverse mapping of RankProfile to Search. 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​(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 - the Search 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