Class MatchPhase

java.lang.Object
com.yahoo.search.query.ranking.MatchPhase
All Implemented Interfaces:
Cloneable

public class MatchPhase extends Object implements Cloneable
The match phase ranking settings of this query. These are the same settings for match phase that can be set in a rank profile and is used for achieving reasonable query behavior given a query which causes too many matches: The engine will fall back to retrieving the best values according to the attribute given here during matching.

For this feature to work well, the order given by the attribute should correlate reasonably with the order of results produced if full evaluation is performed.

Author:
bratseth
  • Field Details

  • Constructor Details

    • MatchPhase

      public MatchPhase()
  • Method Details

    • getArgumentType

      public static QueryProfileType getArgumentType()
    • setAttribute

      public void setAttribute(String attribute)
      Sets the attribute field which will be used to decide the best matches after it has been determined during matching that this query is going to cause too many matches. Set to null (default) to disable degradation.

      If this is set, make sure to also set the maxHits value. Otherwise, the attribute setting is ignored.

      This attribute should have fast-search turned on.

    • getAttribute

      public String getAttribute()
      Returns the attribute to use for degradation, or null if none
    • setAscending

      public void setAscending(boolean ascending)
      Set to true to sort by the attribute in ascending order when this is in use during the match phase, false (default) to use descending order.
    • getAscending

      public boolean getAscending()
      Returns the order to sort the attribute during the path phase when this takes effect.
    • setMaxHits

      public void setMaxHits(long maxHits)
      Sets the max hits to aim for producing in the match phase. This must be set if an attribute value is set. It should be set to a reasonable fraction of the total documents on each partition.
    • setMaxFilterCoverage

      public void setMaxFilterCoverage(double maxFilterCoverage)
    • getMaxHits

      public Long getMaxHits()
      Returns the max hits to aim for producing in the match phase on each content node, or null if not set
    • getMaxFilterCoverage

      public Double getMaxFilterCoverage()
    • getDiversity

      public Diversity getDiversity()
    • setDiversity

      public void setDiversity(Diversity diversity)
    • prepare

      public void prepare(RankProperties rankProperties)
      Internal operation - DO NOT USE
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • clone

      public MatchPhase clone()
      Overrides:
      clone in class Object