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?,     val pointInTimeId: String?,     val suggest: Map<String, List<SearchResponse.Suggest>>?)

Constructors

Link copied to clipboard
constructor(    took: Long?,     shards: Shards?,     timedOut: Boolean?,     hits: SearchResponse.Hits?,     aggregations: Aggregations?,     scrollId: String?,     pitId: String?,     pointInTimeId: String?,     suggest: Map<String, List<SearchResponse.Suggest>>?)

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

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 = "point_in_time_id")
val pointInTimeId: 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
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.