Class RatedDocument

  • All Implemented Interfaces:
    Writeable, ToXContent, ToXContentObject

    public class RatedDocument
    extends java.lang.Object
    implements Writeable, 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
     }
     
    • Constructor Detail

      • RatedDocument

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

      • getKey

        public org.opensearch.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​(StreamOutput out)
                     throws java.io.IOException
        Specified by:
        writeTo in interface Writeable
        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