Hit

@Serializable
data class Hit(    val index: String,     val type: String?,     val id: String,     val score: Double?,     val source: JsonObject?,     val fields: JsonObject?,     val sort: JsonArray?,     val innerHits: Map<String, HitsContainer>?,     val highlight: JsonObject?,     val seqNo: Long? = null,     val primaryTerm: Long? = null,     val version: Long?,     val explanation: JsonObject?,     val matchedQueries: MatchedQueries?) : SourceInformation

Constructors

Link copied to clipboard
constructor(    index: String,     type: String?,     id: String,     score: Double?,     source: JsonObject?,     fields: JsonObject?,     sort: JsonArray?,     innerHits: Map<String, HitsContainer>?,     highlight: JsonObject?,     seqNo: Long? = null,     primaryTerm: Long? = null,     version: Long?,     explanation: JsonObject?,     matchedQueries: MatchedQueries?)

Properties

Link copied to clipboard
@SerialName(value = "_explanation")
val explanation: JsonObject?
Link copied to clipboard
val fields: JsonObject?
Link copied to clipboard
val highlight: JsonObject?
Link copied to clipboard
@SerialName(value = "_id")
open override val id: String
Link copied to clipboard
@SerialName(value = "_index")
val index: String
Link copied to clipboard
@SerialName(value = "inner_hits")
val innerHits: Map<String, HitsContainer>?
Link copied to clipboard
@SerialName(value = "matched_queries")
val matchedQueries: MatchedQueries?

If named queries are used, the response includes a matched_queries property for each hit. There are two forms of the matched_queries response:

Link copied to clipboard
@SerialName(value = "_primary_term")
open override val primaryTerm: Long? = null
Link copied to clipboard
@SerialName(value = "_score")
val score: Double?
Link copied to clipboard
@SerialName(value = "_seq_no")
open override val seqNo: Long? = null
Link copied to clipboard
val sort: JsonArray?
Link copied to clipboard
@SerialName(value = "_source")
open override val source: JsonObject?
Link copied to clipboard
@SerialName(value = "_type")
val type: String?
Link copied to clipboard
@SerialName(value = "_version")
open override val version: Long?

Functions

Link copied to clipboard
inline fun <T> SourceInformation.document(json: Json = DEFAULT_JSON): T
Link copied to clipboard
inline fun <T> SearchResponse.Hit.parseHit(json: Json = DEFAULT_JSON): T
fun <T> SearchResponse.Hit.parseHit(deserializationStrategy: DeserializationStrategy<T>, json: Json = DEFAULT_JSON): T