java.lang.Object
org.apache.lucene.search.ScoreDoc
org.elasticsearch.search.rank.RankDoc
- All Implemented Interfaces:
Comparable<RankDoc>,NamedWriteable,VersionedNamedWriteable,Writeable,ToXContent,ToXContentFragment
- Direct Known Subclasses:
RankFeatureDoc
public class RankDoc
extends org.apache.lucene.search.ScoreDoc
implements VersionedNamedWriteable, ToXContentFragment, Comparable<RankDoc>
RankDoc is the base class for all ranked results.
Subclasses should extend this with additional information required for their global ranking method.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, 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 intintIf this document has been ranked, this is its final rrf ranking from all the result sets.Fields inherited from class org.apache.lucene.search.ScoreDoc
doc, score, shardIndexFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal intprotected booleanprotected intprotected voiddoToXContent(XContentBuilder builder, ToXContent.Params params) protected voiddoWriteTo(StreamOutput out) final booleanorg.apache.lucene.search.ExplanationExplain the ranking of this document.The minimal version of the recipient this object can be sent toReturns the name of the writeable objectfinal inthashCode()toString()final XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params) final voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
NAME
- See Also:
-
NO_RANK
public static final int NO_RANK- See Also:
-
rank
public int rankIf this document has been ranked, this is its final rrf ranking from all the result sets.
-
-
Constructor Details
-
RankDoc
public RankDoc(int doc, float score, int shardIndex) -
RankDoc
- Throws:
IOException
-
-
Method Details
-
getWriteableName
Description copied from interface:VersionedNamedWriteableReturns the name of the writeable object- Specified by:
getWriteableNamein interfaceNamedWriteable- Specified by:
getWriteableNamein interfaceVersionedNamedWriteable
-
getMinimalSupportedVersion
Description copied from interface:VersionedNamedWriteableThe minimal version of the recipient this object can be sent to- Specified by:
getMinimalSupportedVersionin interfaceVersionedNamedWriteable
-
compareTo
- Specified by:
compareToin interfaceComparable<RankDoc>
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
doWriteTo
- Throws:
IOException
-
explain
public org.apache.lucene.search.Explanation explain(org.apache.lucene.search.Explanation[] sourceExplanations, String[] queryNames) Explain the ranking of this document. -
toXContent
public final XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
doToXContent
- Throws:
IOException
-
equals
-
doEquals
-
hashCode
public final int hashCode() -
doHashCode
protected int doHashCode() -
toString
- Overrides:
toStringin classorg.apache.lucene.search.ScoreDoc
-