# 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)

*** ** * ** ***


```
class GetByDocumentIdRequest.Builder
```

<br />

*** ** * ** ***

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

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetByDocumentIdRequest.Builder#Builder(java.lang.String)(namespace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetByDocumentIdRequest.Builder` instance. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetByDocumentIdRequest.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetByDocumentIdRequest.Builder#addIds(java.lang.String...)(ids: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>)` Adds one or more document IDs to the request. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetByDocumentIdRequest.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetByDocumentIdRequest.Builder#addIds(java.util.Collection<java.lang.String>)(ids: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>)` Adds a collection of IDs to the request. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetByDocumentIdRequest.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetByDocumentIdRequest.Builder#addProjection(java.lang.String,java.util.Collection<java.lang.String>)( schemaType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, propertyPaths: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!> )` Adds property paths for the specified type to be used for projection. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetByDocumentIdRequest.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetByDocumentIdRequest.Builder#addProjectionPaths(java.lang.String,java.util.Collection<androidx.appsearch.app.PropertyPath>)( schemaType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, propertyPaths: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath!> )` Adds property paths for the specified type to be used for projection. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetByDocumentIdRequest` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetByDocumentIdRequest.Builder#build()()` Builds a new `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetByDocumentIdRequest`. |

## Public constructors

### Builder

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

```
Builder(namespace: String)
```

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

## Public functions

### addIds

```
fun addIds(ids: Array<String!>): GetByDocumentIdRequest.Builder
```

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)

```
fun addIds(ids: (Mutable)Collection<String!>): GetByDocumentIdRequest.Builder
```

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)

```
fun addProjection(
    schemaType: String,
    propertyPaths: (Mutable)Collection<String!>
): GetByDocumentIdRequest.Builder
```

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/kotlin/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/kotlin/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)

```
fun addProjectionPaths(
    schemaType: String,
    propertyPaths: (Mutable)Collection<PropertyPath!>
): GetByDocumentIdRequest.Builder
```

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/kotlin/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/kotlin/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)

```
fun build(): GetByDocumentIdRequest
```

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