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 Summary

      Constructors 
      Constructor Description
      SearchChain​(com.yahoo.component.chain.Chain<Searcher> chain)
      For internal use only!
      SearchChain​(com.yahoo.component.ComponentId id)  
      SearchChain​(com.yahoo.component.ComponentId id, Searcher... searchers)  
      SearchChain​(com.yahoo.component.ComponentId id, java.util.Collection<Searcher> searchers)  
      SearchChain​(com.yahoo.component.ComponentId id, java.util.Collection<Searcher> searchers, java.util.Collection<com.yahoo.component.chain.Phase> phases)
      Creates a search chain.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<Searcher> searchers()
      Returns an unmodifiable list of the searchers this search chain executs, in resolved execution order.
      java.lang.String toString()  
      • Methods inherited from class com.yahoo.component.chain.Chain

        components, equals, getId, hashCode
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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,
                           java.util.Collection<Searcher> searchers)
      • SearchChain

        public SearchChain​(com.yahoo.component.ComponentId id,
                           java.util.Collection<Searcher> searchers,
                           java.util.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 java.util.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 java.lang.String toString()
        Overrides:
        toString in class com.yahoo.component.chain.Chain<Searcher>