# GetByDocumentIdRequest.Builder

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

*** ** * ** ***


```
public final class GetByDocumentIdRequest.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest` objects.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest.Builder#Builder(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html namespace)` Creates a `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest.Builder` instance. |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest.Builder#addIds(java.lang.String...)(@https://developer.android.com/reference/androidx/annotation/NonNull String[] ids)` Adds one or more document IDs to the request. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest.Builder#addIds(java.util.Collection<java.lang.String>)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/java/lang/String.html> ids)` Adds a collection of IDs to the request. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest.Builder#addProjection(java.lang.String,java.util.Collection<java.lang.String>)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html schemaType, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/java/lang/String.html> propertyPaths )` Adds property paths for the specified type to be used for projection. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest.Builder#addProjectionPaths(java.lang.String,java.util.Collection<androidx.appsearch.app.PropertyPath>)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html schemaType, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/androidx/appsearch/app/PropertyPath> propertyPaths )` Adds property paths for the specified type to be used for projection. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest` | `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest.Builder#build()()` Builds a new `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest`. |

## Public constructors

### Builder

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

```
public Builder(@NonNull String namespace)
```

Creates a `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest.Builder` instance.

## Public methods

### addIds

```
public @NonNull GetByDocumentIdRequest.Builder addIds(@NonNull String[] ids)
```

Adds one or more document IDs to the request.

### addIds

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

```
public @NonNull GetByDocumentIdRequest.Builder addIds(@NonNull Collection<String> ids)
```

Adds a collection of IDs to the request.

### addProjection

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

```
public @NonNull GetByDocumentIdRequest.Builder addProjection(
    @NonNull String schemaType,
    @NonNull Collection<String> propertyPaths
)
```

Adds property paths for the specified type to be used for projection. If property paths are added for a type, then only the properties referred to will be retrieved for results of that type. If a property path that is specified isn't present in a result, it will be ignored for that result. Property paths cannot be null.

If no property paths are added for a particular type, then all properties of results of that type will be retrieved.

If property path is added for the `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest#PROJECTION_SCHEMA_TYPE_WILDCARD()`, then those property paths will apply to all results, excepting any types that have their own, specific property paths set.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/appsearch/app/SearchSpec.Builder#addProjectionPaths(java.lang.String,java.util.Collection<androidx.appsearch.app.PropertyPath>)` |   |

### addProjectionPaths

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

```
public @NonNull GetByDocumentIdRequest.Builder addProjectionPaths(
    @NonNull String schemaType,
    @NonNull Collection<PropertyPath> propertyPaths
)
```

Adds property paths for the specified type to be used for projection. If property paths are added for a type, then only the properties referred to will be retrieved for results of that type. If a property path that is specified isn't present in a result, it will be ignored for that result. Property paths cannot be null.

If no property paths are added for a particular type, then all properties of results of that type will be retrieved.

If property path is added for the `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest#PROJECTION_SCHEMA_TYPE_WILDCARD()`, then those property paths will apply to all results, excepting any types that have their own, specific property paths set.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/appsearch/app/SearchSpec.Builder#addProjectionPaths(java.lang.String,java.util.Collection<androidx.appsearch.app.PropertyPath>)` |   |

### build

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

```
public @NonNull GetByDocumentIdRequest build()
```

Builds a new `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest`.