Class FieldCollapsingSearcher

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

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

      • FieldCollapsingSearcher

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

        public FieldCollapsingSearcher​(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,
                                       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