Class Vertex

java.lang.Object
org.elasticsearch.client.graph.Vertex
All Implemented Interfaces:
org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment

public class Vertex
extends java.lang.Object
implements org.elasticsearch.common.xcontent.ToXContentFragment
A vertex in a graph response represents a single term (a field and value pair) which appears in one or more documents found as part of the graph exploration. A vertex term could be a bank account number, an email address, a hashtag or any other term that appears in documents and is interesting to represent in a network.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  Vertex.VertexId
    An identifier (implements hashcode and equals) that represents a unique key for a Vertex

    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
  • Field Summary

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

    EMPTY_PARAMS
  • Constructor Summary

    Constructors 
    Constructor Description
    Vertex​(java.lang.String field, java.lang.String term, double weight, int depth, long bg, long fg)  
  • Method Summary

    Modifier and Type Method Description
    static Vertex.VertexId createId​(java.lang.String field, java.lang.String term)
    A convenience method for creating a Vertex.VertexId
    boolean equals​(java.lang.Object obj)  
    long getBg()
    If the GraphExploreRequest.useSignificance(boolean) is true (the default) this statistic is available.
    long getFg()
    If the GraphExploreRequest.useSignificance(boolean) is true (the default) this statistic is available.
    java.lang.String getField()  
    int getHopDepth()  
    Vertex.VertexId getId()  
    java.lang.String getTerm()  
    double getWeight()
    The weight of a vertex is an accumulation of all of the Connections that are linked to this Vertex as part of a graph exploration.
    int hashCode()  
    void setFg​(long fg)  
    void setWeight​(double weight)  
    java.lang.String toString()  
    org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

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

    isFragment
  • Constructor Details

    • Vertex

      public Vertex​(java.lang.String field, java.lang.String term, double weight, int depth, long bg, long fg)
  • Method Details

    • hashCode

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

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
      java.io.IOException
    • getId

      public Vertex.VertexId getId()
      Returns:
      a Vertex.VertexId object that uniquely identifies this Vertex
    • createId

      public static Vertex.VertexId createId​(java.lang.String field, java.lang.String term)
      A convenience method for creating a Vertex.VertexId
      Parameters:
      field - the field
      term - the term
      Returns:
      a Vertex.VertexId that can be used for looking up vertices
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • getField

      public java.lang.String getField()
    • getTerm

      public java.lang.String getTerm()
    • getWeight

      public double getWeight()
      The weight of a vertex is an accumulation of all of the Connections that are linked to this Vertex as part of a graph exploration. It is used internally to identify the most interesting vertices to be returned.
      Returns:
      a measure of the Vertex's relative importance.
    • setWeight

      public void setWeight​(double weight)
    • getBg

      public long getBg()
      If the GraphExploreRequest.useSignificance(boolean) is true (the default) this statistic is available.
      Returns:
      the number of documents in the index that contain this term (see bg_count in the significant_terms aggregation)
    • getFg

      public long getFg()
      If the GraphExploreRequest.useSignificance(boolean) is true (the default) this statistic is available. Together with getBg() these numbers are used to derive the significance of a term.
      Returns:
      the number of documents in the sample of best matching documents that contain this term (see fg_count in the significant_terms aggregation)
    • setFg

      public void setFg​(long fg)
    • getHopDepth

      public int getHopDepth()
      Returns:
      the sequence number in the series of hops where this Vertex term was first encountered