PlatformStorage.SearchContext

public static final class PlatformStorage.SearchContext
extends Object

java.lang.Object
   ↳ androidx.appsearch.platformstorage.PlatformStorage.SearchContext


Contains information about how to create the search session.

Summary

Nested classes

class PlatformStorage.SearchContext.Builder

Builder for PlatformStorage.SearchContext objects. 

Public methods

String getDatabaseName()

Returns the name of the database to create or open.

Executor getWorkerExecutor()

Returns the worker executor associated with AppSearchSession.

Inherited methods

Public methods

getDatabaseName

public String getDatabaseName ()

Returns the name of the database to create or open.

Returns
String

getWorkerExecutor

public Executor getWorkerExecutor ()

Returns the worker executor associated with AppSearchSession.

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

Returns
Executor