search
Performs a synchronous search computing action based on the provided SearchOptions object and delivers the Result by the provided SearchResponse, or by a SearchFailure if the action fails.
Return
The Result contains a SearchResponse in if the call succeeds or a SearchFailure if it fails.
Example of a search request:
val searchOptions = SearchOptions(
query = "restaurant",
)
val response = search.search(searchOptions)
if (response.isSuccess()) {
val result: SearchResponse = response.value()
Log.d("tag", "Search results: ${result.results}")
} else {
val failure: SearchFailure = response.failure()
Log.e("tag", failure.message)
}
Parameters
The object which contains the data necessary to execute the search action.
Performs an asynchronous search computing action based on the provided SearchOptions object and returns the result by the provided SearchCallback.
Return
Cancellable search operation.
Example of an search request:
val searchOptions = SearchOptions(
query = "restaurant",
)
val response = search.search(searchOptions, object : SearchCallback {
override fun onSuccess(result: SearchResponse) {
Log.d("tag", "Search results: ${result.results}")
}
override fun onFailure(failure: SearchFailure) {
Log.e("tag", failure.message)
}
})
Parameters
The configuration options for the search.
The SearchCallback invoked when the search operation has been finished either successfully or with an error. The callback will be executed in the main thread.