Class MatchPhase

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class MatchPhase
    extends java.lang.Object
    implements java.lang.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
    • Constructor Summary

      Constructors 
      Constructor Description
      MatchPhase()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      MatchPhase clone()  
      boolean equals​(java.lang.Object o)  
      static QueryProfileType getArgumentType()  
      boolean getAscending()
      Returns the order to sort the attribute during the path phase when this takes effect.
      java.lang.String getAttribute()
      Returns the attribute to use for degradation, or null if none
      Diversity getDiversity()  
      java.lang.Double getMaxFilterCoverage()  
      java.lang.Long getMaxHits()
      Returns the max hits to aim for producing in the match phase on each content node, or null if not set
      int hashCode()  
      void prepare​(RankProperties rankProperties)
      Internal operation - DO NOT USE
      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.
      void setAttribute​(java.lang.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.
      void setDiversity​(Diversity diversity)  
      void setMaxFilterCoverage​(double maxFilterCoverage)  
      void setMaxHits​(long maxHits)
      Sets the max hits to aim for producing in the match phase.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MatchPhase

        public MatchPhase()
    • Method Detail

      • setAttribute

        public void setAttribute​(java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • clone

        public MatchPhase clone()
        Overrides:
        clone in class java.lang.Object