Skip to content
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

searchSingleIndex doesn't support offset,length pagination query #4

Open
LaysDragon opened this issue Jan 9, 2024 · 1 comment
Open

Comments

@LaysDragon
Copy link

When passing offset,length parameter into searchSingleIndex ,the response have different data then what decoder expect causing error.

I/flutter (11302): CheckedFromJsonException
I/flutter (11302): Could not create `SearchResponse`.
I/flutter (11302): There is a problem with "hitsPerPage".
I/flutter (11302): type 'Null' is not a subtype of type 'int' in type cast
I/flutter (11302): #0      $checkedConvert (package:json_annotation/src/checked_helpers.dart:91:5)
I/flutter (11302): #1      $checkedCreate.checkedConvert (package:json_annotation/src/checked_helpers.dart:28:7)
I/flutter (11302): #2      _$SearchResponseFromJson.<anonymous closure> (package:algolia_client_search/src/model/search_response.g.dart:41:39)
I/flutter (11302): #3      $checkedCreate.<anonymous closure> (package:json_annotation/src/checked_helpers.dart:33:22)
I/flutter (11302): #4      $checkedNew (package:json_annotation/src/checked_helpers.dart:51:23)
I/flutter (11302): #5      $checkedCreate (package:json_annotation/src/checked_helpers.dart:30:10)
I/flutter (11302): #6      _$SearchResponseFromJson (package:algolia_client_search/src/model/search_response.g.dart:10:5)
I/flutter (11302): #7      new SearchResponse.fromJson (package:algolia_client_search/src/model/search_response.dart:234:7)
I/flutter (11302): #8      deserialize (package:algolia_client_search/src/deserialize.dart:454:29)
I/flutter (11302): #9      SearchClient.searchSingleIndex (package:algolia_client_search/src/api/search_client.dart:1987:12)
I/flutter (11302): <asynchronous suspension>
@andrasfecz
Copy link

Using the same thing searchSingleIndex, passing offset & length but getting a different error about 'page' missing. Page should not be required if using offset & length

com.algolia.client.exception.AlgoliaClientException: Illegal input: Key page is missing in the map.
	at com.algolia.client.exception.internal.ThrowableKt.asClientException(Throwable.kt:10)
	at com.algolia.client.transport.internal.KtorRequester.onError(KtorRequester.kt:109)
	at com.algolia.client.transport.internal.KtorRequester.execute(KtorRequester.kt:74)
	at com.algolia.client.transport.internal.KtorRequester$execute$1.invokeSuspend(Unknown Source:14)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:102)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702)
Caused by: io.ktor.serialization.JsonConvertException: Illegal input: Key page is missing in the map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants