org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic
org.elasticsearch.search.aggregations.bucket.terms.heuristic.ScriptHeuristic
All Implemented Interfaces:
NamedWriteable, Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment

public class ScriptHeuristic extends SignificanceHeuristic
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
     

    Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent

    org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params

    Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable

    Writeable.Reader<V>, Writeable.Writer<V>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static
     
    static org.elasticsearch.common.xcontent.ConstructingObjectParser<>
     

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Read from a stream.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     obj)
     
    double
    getScore​(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize)
    Calculates score with a script
    Returns the name of the writeable object
    int
     
    Provides a hook for subclasses to provide a version of the heuristic prepared for execution on data on the coordinating node.
    Provides a hook for subclasses to provide a version of the heuristic prepared for execution on data on a shard.
    org.elasticsearch.common.xcontent.XContentBuilder
    toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params builderParams)
     
    void
    Write this into the StreamOutput.

    Methods inherited from class org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic

    checkFrequencyValidity

    Methods inherited from class java.lang.

    , , , , , , , ,

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment

    isFragment
  • Field Details

    • NAME

      public static final  NAME
      See Also:
      Constant Field Values
    • PARSER

      public static final org.elasticsearch.common.xcontent.ConstructingObjectParser<> PARSER
  • Constructor Details

    • ScriptHeuristic

      public ScriptHeuristic(Script script)
    • ScriptHeuristic

      public ScriptHeuristic(StreamInput in) throws
      Read from a stream.
      Throws:
  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Throws:
    • rewrite

      Description copied from class: SignificanceHeuristic
      Provides a hook for subclasses to provide a version of the heuristic prepared for execution on data on the coordinating node.
      Overrides:
      rewrite in class SignificanceHeuristic
      Parameters:
      context - the reduce context on the coordinating node
      Returns:
      a version of this heuristic suitable for execution
    • rewrite

      public SignificanceHeuristic rewrite(AggregationContext context)
      Description copied from class: SignificanceHeuristic
      Provides a hook for subclasses to provide a version of the heuristic prepared for execution on data on a shard.
      Overrides:
      rewrite in class SignificanceHeuristic
      Parameters:
      context - the shard context on the data node
      Returns:
      a version of this heuristic suitable for execution
    • getScore

      public double getScore(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize)
      Calculates score with a script
      Specified by:
      getScore in class SignificanceHeuristic
      Parameters:
      subsetFreq - The frequency of the term in the selected sample
      subsetSize - The size of the selected sample (typically number of docs)
      supersetFreq - The frequency of the term in the superset from which the sample was taken
      supersetSize - The size of the superset from which the sample was taken (typically number of docs)
      Returns:
      a "significance" score
    • getWriteableName

      public  getWriteableName()
      Description copied from interface: NamedWriteable
      Returns the name of the writeable object
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params builderParams) throws
      Throws:
    • hashCode

      public int hashCode()
      Overrides:
       in class 
    • equals

      public boolean equals( obj)
      Overrides:
       in class