LocalStorage.SearchContext

public static final class LocalStorage.SearchContext
extends Object

java.lang.Object
   ↳ androidx.appsearch.localstorage.LocalStorage.SearchContext


Contains information about how to create the search session.

Summary

Nested classes

class LocalStorage.SearchContext.Builder

Builder for LocalStorage.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 LocalStorage.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