Class Ranking

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

public class Ranking extends Object implements Cloneable
The ranking (hit ordering) settings of a query
Author:
Arne Bergene Fossaa, bratseth
  • Field Details

  • Constructor Details

    • Ranking

      public Ranking(Query parent)
  • Method Details

    • getArgumentType

      public static QueryProfileType getArgumentType()
    • hasRankProfile

      public boolean hasRankProfile()
      Returns whether a rank profile has been explicitly set. This is only used in serializing the packet properly to FS4.
    • getFreshness

      public Freshness getFreshness()
      Get the freshness search parameters associated with this query
    • setFreshness

      public void setFreshness(String dateTime)
      Set the freshness search parameters for this query
    • setFreshness

      public void setFreshness(Freshness freshness)
    • setQueryCache

      public void setQueryCache(boolean queryCache)
      Returns whether feature caching is turned on in the backed. Feature caching allows us to avoid sending the query during document summary retrieval and recalculate feature scores, it is typically beneficial to turn it on if fan-out is low or queries are large.

      Default is false (off).

    • getQueryCache

      public boolean getQueryCache()
    • setRerankCount

      public void setRerankCount(int rerankCount)
      Sets the number of hits for which the second-phase function will be evaluated. When set, this overrides the setting in the rank profile.
    • getRerankCount

      public Integer getRerankCount()
      Returns the rerank-count that will be used, or null if not set
    • setKeepRankCount

      public void setKeepRankCount(int keepRankCount)
      Sets the keep-rank-count that will be used, or null if not set
    • getKeepRankCount

      public Integer getKeepRankCount()
      Returns the keep-rank-count that will be used, or null if not set
    • setRankScoreDropLimit

      public void setRankScoreDropLimit(double rankScoreDropLimit)
      Sets the rank-score-drop-limit that will be used, or null if not set
    • getRankScoreDropLimit

      public Double getRankScoreDropLimit()
      Returns the rank-score-drop-limit that will be used, or null if not set
    • getLocation

      public Location getLocation()
      Returns the location of this query, or null if none
    • setLocation

      public void setLocation(Location location)
    • setLocation

      public void setLocation(String str)
      Sets the location from a string, see Location for syntax
    • getProfile

      public String getProfile()
      Returns the name of the rank profile to be used. Returns "default" if nothing is set.
    • setProfile

      public void setProfile(String profile)
      Sets the name of the rank profile to use. This cannot be set to null.
    • getFeatures

      public RankFeatures getFeatures()
      Returns the rank features of this, an empty container (never null) if none are set. The returned object can be modified directly to change the rank properties of this.
    • getProperties

      public RankProperties getProperties()
      Returns the rank properties of this, an empty container (never null) if none are set. The returned object can be modified directly to change the rank properties of this.
    • setListFeatures

      public void setListFeatures(boolean listFeatures)
      Set whether rank features should be included with the result of this query
    • getListFeatures

      public boolean getListFeatures()
      Returns whether rank features should be dumped with the result of this query, default false
    • getMatchPhase

      public MatchPhase getMatchPhase()
      Returns the match phase rank settings of this. This is never null.
    • getGlobalPhase

      public GlobalPhase getGlobalPhase()
      Returns the global-phase rank settings of this. This is never null.
    • getMatching

      public Matching getMatching()
      Returns the matching settings of this. This is never null.
    • getSoftTimeout

      public SoftTimeout getSoftTimeout()
      Returns the soft timeout settings of this. This is never null.
    • getSorting

      public Sorting getSorting()
      Returns the sorting spec of this query, or null if none is set
    • setSorting

      public void setSorting(Sorting sorting)
      Sets how this query should be sorted. Set to null to turn off explicit sorting.
    • setSorting

      public void setSorting(String sortingString)
      Sets sorting from a string. See Sorting on syntax
    • getFrom

      public static Ranking getFrom(Query q)
    • prepare

      public void prepare()
    • getParent

      public Query getParent()
      Returns the query owning this, never null
    • clone

      public Ranking clone()
      Overrides:
      clone in class Object
    • cloneFor

      public Ranking cloneFor(Query parent)
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object