Skip to content

Commit 57b201d

Browse files
committed
Rename to ResponseHitWithPosition
1 parent 9dda097 commit 57b201d

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/commonMain/kotlin/com/algolia/search/endpoint/EndpointSearch.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ package com.algolia.search.endpoint
22

33
import com.algolia.search.model.Attribute
44
import com.algolia.search.model.IndexName
5-
import com.algolia.search.model.filter.Filter
65
import com.algolia.search.model.filter.FilterGroup
7-
import com.algolia.search.model.response.ResponseHitsWithPosition
6+
import com.algolia.search.model.response.ResponseHitWithPosition
87
import com.algolia.search.model.response.ResponseSearch
98
import com.algolia.search.model.response.ResponseSearchForFacets
109
import com.algolia.search.model.search.Cursor
@@ -143,5 +142,5 @@ public interface EndpointSearch {
143142
query: Query = Query(),
144143
doNotPaginate: Boolean = false,
145144
requestOptions: RequestOptions? = null
146-
): ResponseHitsWithPosition?
145+
): ResponseHitWithPosition?
147146
}

src/commonMain/kotlin/com/algolia/search/endpoint/EndpointSearchImpl.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import com.algolia.search.model.filter.Filter
99
import com.algolia.search.model.filter.FilterGroup
1010
import com.algolia.search.model.multipleindex.IndexQuery
1111
import com.algolia.search.model.request.RequestParams
12-
import com.algolia.search.model.response.ResponseHitsWithPosition
12+
import com.algolia.search.model.response.ResponseHitWithPosition
1313
import com.algolia.search.model.response.ResponseSearch
1414
import com.algolia.search.model.response.ResponseSearchForFacets
1515
import com.algolia.search.model.response.ResponseSearches
@@ -40,13 +40,13 @@ internal class EndpointSearchImpl(
4040
query: Query,
4141
doNotPaginate: Boolean,
4242
requestOptions: RequestOptions?
43-
): ResponseHitsWithPosition? {
43+
): ResponseHitWithPosition? {
4444
val response = search(query, requestOptions)
4545
val hit = response.hits.find(match)
4646
val hasNextPage = response.page + 1 < response.nbPages
4747

4848
return if (hit != null) {
49-
ResponseHitsWithPosition(hit, response.hits.indexOf(hit), response.page)
49+
ResponseHitWithPosition(hit, response.hits.indexOf(hit), response.page)
5050
} else if (!doNotPaginate && hasNextPage) {
5151
findFirstObject(match, query.copy(page = (query.page ?: 0) + 1), doNotPaginate, requestOptions)
5252
} else null

src/commonMain/kotlin/com/algolia/search/model/response/ResponseHitsWithPosition.kt renamed to src/commonMain/kotlin/com/algolia/search/model/response/ResponseHitWithPosition.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import kotlinx.serialization.Serializable
44

55

66
@Serializable
7-
public data class ResponseHitsWithPosition(
7+
public data class ResponseHitWithPosition(
88
val hit: ResponseSearch.Hit,
99
val position: Int,
1010
val page: Int

0 commit comments

Comments
 (0)