PlatformStorage.SearchContext


class PlatformStorage.SearchContext


Contains information about how to create the search session.

Summary

Nested types

Builder for SearchContext objects.

Public functions

Context

Returns the Context associated with the AppSearchSession

String

Returns the name of the database to create or open.

Executor

Returns the worker executor associated with AppSearchSession.

Public functions

getContext

Added in 1.1.0-alpha07
fun getContext(): Context

Returns the Context associated with the AppSearchSession

getDatabaseName

Added in 1.1.0-alpha07
fun getDatabaseName(): String

Returns the name of the database to create or open.

getWorkerExecutor

Added in 1.1.0-alpha07
fun getWorkerExecutor(): Executor

Returns the worker executor associated with AppSearchSession.

If an executor is not provided to Builder, the AppSearch default executor will be returned. You should never cast the executor to java.util.concurrent.ExecutorService and call shutdownNow. It will cancel the futures it's returned. And since execute won't return anything, we will hang forever waiting for the execution.