Class RatedDocument

  • All Implemented Interfaces:
    org.elasticsearch.common.io.stream.Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject

    public class RatedDocument
    extends java.lang.Object
    implements org.elasticsearch.common.io.stream.Writeable, org.elasticsearch.common.xcontent.ToXContentObject
    Represents a document (specified by its _index/_id) and its corresponding rating with respect to a specific search query.

    The json structure of this element in a request:

     {
       "_index": "my_index",
       "_id": "doc1",
       "rating": 0
     }
     
    • Nested Class Summary

      • 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

        org.elasticsearch.common.io.stream.Writeable.Reader<V extends java.lang.Object>, org.elasticsearch.common.io.stream.Writeable.Writer<V extends java.lang.Object>
    • Field Summary

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

        EMPTY_PARAMS
    • Constructor Summary

      Constructors 
      Constructor Description
      RatedDocument​(java.lang.String index, java.lang.String id, int rating)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.lang.String getDocID()  
      java.lang.String getIndex()  
      org.elasticsearch.index.rankeval.RatedDocument.DocumentKey getKey()  
      int getRating()  
      int hashCode()  
      java.lang.String toString()  
      org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)  
      void writeTo​(org.elasticsearch.common.io.stream.StreamOutput out)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject

        isFragment
    • Constructor Detail

      • RatedDocument

        public RatedDocument​(java.lang.String index,
                             java.lang.String id,
                             int rating)
    • Method Detail

      • getKey

        public org.elasticsearch.index.rankeval.RatedDocument.DocumentKey getKey()
      • getIndex

        public java.lang.String getIndex()
      • getDocID

        public java.lang.String getDocID()
      • getRating

        public int getRating()
      • writeTo

        public void writeTo​(org.elasticsearch.common.io.stream.StreamOutput out)
                     throws java.io.IOException
        Specified by:
        writeTo in interface org.elasticsearch.common.io.stream.Writeable
        Throws:
        java.io.IOException
      • 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
      • toString

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

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

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