Skip to content

ISSUE-167: Add suggest to SearchResponse #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
package com.jillesvangurp.ktsearch

import com.jillesvangurp.ktsearch.repository.ModelSerializationStrategy
import com.jillesvangurp.searchdsls.querydsl.GeoTileGridAgg
import com.jillesvangurp.searchdsls.querydsl.Shape
import com.jillesvangurp.serializationext.DEFAULT_JSON
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
Expand All @@ -31,8 +29,27 @@ data class SearchResponse(
@SerialName("_scroll_id")
val scrollId: String?,
@SerialName("pit_id")
val pitId: String?
val pitId: String?,
val suggest: Map<String, List<Suggest>>?
) {
@Serializable
data class Suggest(
val text: String,
val offset: Int,
val length: Int,
val options: List<Option>
) {
@Serializable
data class Option(
val text: String,
val score: Double,
val freq: Int?,
@SerialName("collate_match")
val collateMatch: Boolean?,
val highlighted: String?
)
}

@Serializable
data class Hit(
@SerialName("_index")
Expand Down
Loading