Class FieldCollapsingSearcher

  • All Implemented Interfaces:
    com.yahoo.component.Component, java.lang.Comparable<com.yahoo.component.Component>

    public class FieldCollapsingSearcher
    extends Searcher
    A searcher which does parametrized collapsing.
    Author:
    Steinar Knutsen
    • Field Summary

      • Fields inherited from class com.yahoo.component.AbstractComponent

        isDeconstructable
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Result search​(Query query, Execution execution)
      First fetch result from the next searcher in the chain.
      • Methods inherited from class com.yahoo.component.chain.ChainedComponent

        getAnnotatedDependencies, getDefaultAnnotatedDependencies, getDependencies, initDependencies
      • Methods inherited from class com.yahoo.component.AbstractComponent

        clone, compareTo, deconstruct, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • FieldCollapsingSearcher

        public FieldCollapsingSearcher()
        Create this searcher using default values for all settings
      • FieldCollapsingSearcher

        public FieldCollapsingSearcher​(java.lang.String collapseField)
        Creates a collapser
        Parameters:
        collapseField - the default field to collapse on, or null to not collapse as default
      • FieldCollapsingSearcher

        @Inject
        public FieldCollapsingSearcher​(com.yahoo.container.QrSearchersConfig config)
      • FieldCollapsingSearcher

        public FieldCollapsingSearcher​(int collapseSize,
                                       double extraFactor,
                                       java.lang.String collapseField)
        Creates a collapser
        Parameters:
        collapseSize - the maximum number of hits to keep per field the default max number of hits in each collapsed group
        extraFactor - the percentage by which to scale up the requested number of hits, to allow some hits to be removed without refetching
        collapseField - the field to collapse on. This is currently ignored.
    • Method Detail

      • search

        public Result search​(Query query,
                             Execution execution)
        First fetch result from the next searcher in the chain. If collapse is active, do collapsing. Otherwise, act as a simple pass through
        Specified by:
        search in class Searcher
        Parameters:
        query - the query
        Returns:
        the result of making this query