SearchResponse

@Serializable
data class SearchResponse(val took: Long?, val shards: Shards?, val timedOut: Boolean?, val hits: SearchResponse.Hits?, val aggregations: Aggregations?, val scrollId: String?, val pitId: String?)

Constructors

Link copied to clipboard
constructor(took: Long?, shards: Shards?, timedOut: Boolean?, hits: SearchResponse.Hits?, aggregations: Aggregations?, scrollId: String?, pitId: String?)

Types

Link copied to clipboard
@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: Int? = null, val primaryTerm: Int? = null, val version: Long?, val explanation: JsonObject?) : SourceInformation
Link copied to clipboard
@Serializable
data class Hits(val maxScore: Double?, val total: SearchResponse.Hits.Total?, val hits: List<SearchResponse.Hit>)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "pit_id")
val pitId: String?
Link copied to clipboard
@SerialName(value = "_scroll_id")
val scrollId: String?
Link copied to clipboard
@SerialName(value = "_shards")
val shards: Shards?
Link copied to clipboard
@SerialName(value = "timed_out")
val timedOut: Boolean?
Link copied to clipboard
val took: Long?
Link copied to clipboard

Functions

Link copied to clipboard
fun <T : Any> SearchResponse.parseHits(deserializationStrategy: ModelSerializationStrategy<T>): List<T>

Version of parseHits that reuses the ModelSerializationStrategy.

inline fun <T> SearchResponse.parseHits(json: Json = DEFAULT_JSON): List<T>

Quick way to get the document hits from a SearchResponse. You can override the default json if you need to.

fun <T> SearchResponse.parseHits(deserializationStrategy: DeserializationStrategy<T>, json: Json = DEFAULT_JSON): List<T>

Non reified version of parseHits that takes a deserializationStrategy.