Fix search request and response fields.

This commit is contained in:
Onuray Sahin 2020-09-17 16:16:01 +03:00 committed by Benoit Marty
parent 8bff468c7c
commit 7c954d220c
3 changed files with 3 additions and 3 deletions

View file

@ -55,7 +55,7 @@ internal class DefaultSearchTask @Inject constructor(
searchCategories = SearchRequestCategories(
roomEvents = SearchRequestRoomEvents(
searchTerm = params.searchTerm,
orderBy = if (params.orderByRecent) SearchRequestOrder.RECENT else SearchRequestOrder.RANK,
orderBy = if (params.orderByRecent) SearchRequestOrder.RECENT.value else SearchRequestOrder.RANK.value,
filter = SearchRequestFilter(
limit = params.limit,
rooms = listOf(params.roomId)

View file

@ -29,7 +29,7 @@ internal data class SearchRequestRoomEvents(
val filter: SearchRequestFilter? = null,
// By default, this is "rank". One of: ["recent", "rank"]
@Json(name = "order_by")
val orderBy: SearchRequestOrder? = null,
val orderBy: String? = null,
// Configures whether any context for the events returned are included in the response.
@Json(name = "event_context")
val eventContext: SearchRequestEventContext? = null

View file

@ -25,7 +25,7 @@ import org.matrix.android.sdk.api.session.events.model.Event
data class SearchResponseItem(
// A number that describes how closely this result matches the search. Higher is closer.
@Json(name = "rank")
val rank: Int? = null,
val rank: Double? = null,
// The event that matched.
@Json(name = "result")
val event: Event