Class SearchChain


  • public class SearchChain
    extends com.yahoo.component.chain.Chain<Searcher>
    A named collection of searchers.

    The searchers may have dependencies which define an ordering of the searchers of this chain.

    Search chains may inherit the searchers of other chains and modify the inherited set of searchers.

    Search chains may be versioned. The version and name string combined is an unique identifier of a search chain.

    A search chain cannot be modified once constructed.

    Author:
    bratseth
    • Constructor Detail

      • SearchChain

        public SearchChain​(com.yahoo.component.ComponentId id)
      • SearchChain

        public SearchChain​(com.yahoo.component.ComponentId id,
                           Searcher... searchers)
      • SearchChain

        public SearchChain​(com.yahoo.component.ComponentId id,
                           Collection<Searcher> searchers)
      • SearchChain

        public SearchChain​(com.yahoo.component.ComponentId id,
                           Collection<Searcher> searchers,
                           Collection<com.yahoo.component.chain.Phase> phases)
        Creates a search chain.

        This search chain makes a copy of the given lists before return and does not modify the argument lists.

        The total set of searchers included in this chain will be

        • The searchers given in searchers.
        • Plus all searchers returned by searchers() on all search chains in inherited. If a searcher with a given name is present in the searchers list in any version, that version will be used, and a searcher with that name will never be included from an inherited search chain. If the same searcher exists in multiple inherited chains, the highest version will be used.
        • Minus all searchers, of any version, whose name exists in the excluded list.
        Parameters:
        id - the id of this search chain
        searchers - the searchers of this chain, or null if none
        phases - the phases of this chain
      • SearchChain

        public SearchChain​(com.yahoo.component.chain.Chain<Searcher> chain)
        For internal use only!
    • Method Detail

      • searchers

        public List<Searcher> searchers()
        Returns an unmodifiable list of the searchers this search chain executs, in resolved execution order. This includes all inherited (and not excluded) searchers.
      • toString

        public String toString()
        Overrides:
        toString in class com.yahoo.component.chain.Chain<Searcher>