Module org.elasticsearch.xcore
Record Class RankedDocsResults.RankedDoc
java.lang.Object
java.lang.Record
org.elasticsearch.xpack.core.inference.results.RankedDocsResults.RankedDoc
- Record Components:
index- the index of the document when it was passed to the cohere rerank APIrelevanceScore-text-
- All Implemented Interfaces:
Comparable<RankedDocsResults.RankedDoc>,Writeable,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject
- Enclosing class:
RankedDocsResults
public static record RankedDocsResults.RankedDoc(int index, float relevanceScore, String text)
extends Record
implements Comparable<RankedDocsResults.RankedDoc>, Writeable, org.elasticsearch.xcontent.ToXContentObject
A record representing a document that has been ranked by the cohere rerank API
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final org.elasticsearch.xcontent.ParseFieldstatic final Stringstatic final Stringstatic final org.elasticsearch.xcontent.ParseFieldstatic final Stringstatic final org.elasticsearch.xcontent.ParseFieldFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasMap()intstatic org.elasticsearch.xcontent.ConstructingObjectParser<RankedDocsResults.RankedDoc, Void> createParser(boolean ignoreUnknownFields) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.static RankedDocsResults.RankedDocof(StreamInput in) floatReturns the value of therelevanceScorerecord component.text()Returns the value of thetextrecord component.toString()Returns a string representation of this record class.org.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
NAME
- See Also:
-
INDEX
- See Also:
-
RELEVANCE_SCORE
- See Also:
-
TEXT
- See Also:
-
INDEX_FIELD
public static final org.elasticsearch.xcontent.ParseField INDEX_FIELD -
RELEVANCE_SCORE_FIELD
public static final org.elasticsearch.xcontent.ParseField RELEVANCE_SCORE_FIELD -
TEXT_FIELD
public static final org.elasticsearch.xcontent.ParseField TEXT_FIELD
-
-
Constructor Details
-
RankedDoc
Creates an instance of aRankedDocrecord class.- Parameters:
index- the value for theindexrecord componentrelevanceScore- the value for therelevanceScorerecord componenttext- the value for thetextrecord component
-
-
Method Details
-
createParser
public static org.elasticsearch.xcontent.ConstructingObjectParser<RankedDocsResults.RankedDoc,Void> createParser(boolean ignoreUnknownFields) -
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceorg.elasticsearch.xcontent.ToXContent- Throws:
IOException
-
of
- Throws:
IOException
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
asMap
-
compareTo
- Specified by:
compareToin interfaceComparable<RankedDocsResults.RankedDoc>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
relevanceScore
public float relevanceScore()Returns the value of therelevanceScorerecord component.- Returns:
- the value of the
relevanceScorerecord component
-
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-