Class MetaHitsFirstComparator

java.lang.Object
com.yahoo.search.result.ChainableComparator
com.yahoo.search.result.MetaHitsFirstComparator
All Implemented Interfaces:
Comparator<Hit>

public class MetaHitsFirstComparator extends ChainableComparator
Ensures that meta hits are sorted before normal hits. All meta hits are considered equal.
Author:
Tony Vaagenes
  • Constructor Details

    • MetaHitsFirstComparator

      public MetaHitsFirstComparator(Comparator<Hit> secondaryComparator)
  • Method Details

    • compare

      public int compare(Hit left, Hit right)
      Description copied from class: ChainableComparator
      Returns the comparison form the secondary comparison, or 0 if the secondary is null. When overriding this in the subclass, always return super.compare(first,second) at the end of the subclass' implementation.
      Specified by:
      compare in interface Comparator<Hit>
      Overrides:
      compare in class ChainableComparator
    • toString

      public String toString()
      Overrides:
      toString in class Object