# LocalStorage.GlobalSearchContext.Builder

Artifact: [androidx.appsearch:appsearch-local-storage](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/localstorage/LocalStorage.java+class:androidx.appsearch.localstorage.LocalStorage.GlobalSearchContext.Builder) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
public final class LocalStorage.GlobalSearchContext.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/androidx/appsearch/localstorage/LocalStorage.GlobalSearchContext` objects.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appsearch/localstorage/LocalStorage.GlobalSearchContext.Builder#Builder(android.content.Context)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context)` |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/localstorage/LocalStorage.GlobalSearchContext` | `https://developer.android.com/reference/androidx/appsearch/localstorage/LocalStorage.GlobalSearchContext.Builder#build()()` Builds a `https://developer.android.com/reference/androidx/appsearch/localstorage/LocalStorage.GlobalSearchContext` instance. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/localstorage/LocalStorage.GlobalSearchContext.Builder` | `https://developer.android.com/reference/androidx/appsearch/localstorage/LocalStorage.GlobalSearchContext.Builder#setWorkerExecutor(java.util.concurrent.Executor)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/concurrent/Executor.html executor)` Sets the worker executor associated with `https://developer.android.com/reference/androidx/appsearch/app/GlobalSearchSession`. |

## Public constructors

### Builder

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public Builder(@NonNull Context context)
```

## Public methods

### build

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public @NonNull LocalStorage.GlobalSearchContext build()
```

Builds a `https://developer.android.com/reference/androidx/appsearch/localstorage/LocalStorage.GlobalSearchContext` instance.

### setWorkerExecutor

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public @NonNull LocalStorage.GlobalSearchContext.Builder setWorkerExecutor(@NonNull Executor executor)
```

Sets the worker executor associated with `https://developer.android.com/reference/androidx/appsearch/app/GlobalSearchSession`.

If an executor is not provided, the AppSearch default executor will be used.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/concurrent/Executor.html executor` | the worker executor used to run heavy background tasks. |