# GetByDocumentIdRequest

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) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
public final class GetByDocumentIdRequest
```

<br />

*** ** * ** ***

Encapsulates a request to retrieve documents by namespace and IDs from the `https://developer.android.com/reference/androidx/appsearch/app/AppSearchSession` database.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/appsearch/app/AppSearchSession#getByDocumentIdAsync(androidx.appsearch.app.GetByDocumentIdRequest)` |   |

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest.Builder` Builder for `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest` objects. |

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest#PROJECTION_SCHEMA_TYPE_WILDCARD() = "*"` Schema type to be used in `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest.Builder#addProjection(java.lang.String,java.util.Collection<java.lang.String>)` to apply property paths to all results, excepting any types that have had their own, specific property paths set. |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest#getIds()()` Returns the set of document IDs attached to the request. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest#getNamespace()()` Returns the namespace attached to the request. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/appsearch/app/PropertyPath>>` | `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest#getProjectionPaths()()` Returns a map from schema type to property paths to be used for projection. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html>>` | `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest#getProjections()()` Returns a map from schema type to property paths to be used for projection. |

## Constants

### PROJECTION_SCHEMA_TYPE_WILDCARD

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

```
public static final String PROJECTION_SCHEMA_TYPE_WILDCARD = "*"
```

Schema type to be used in `https://developer.android.com/reference/androidx/appsearch/app/GetByDocumentIdRequest.Builder#addProjection(java.lang.String,java.util.Collection<java.lang.String>)` to apply property paths to all results, excepting any types that have had their own, specific property paths set.

## Public methods

### getIds

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

```
public @NonNull Set<String> getIds()
```

Returns the set of document IDs attached to the request.

### getNamespace

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

```
public @NonNull String getNamespace()
```

Returns the namespace attached to the request.

### getProjectionPaths

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

```
public @NonNull Map<String, List<PropertyPath>> getProjectionPaths()
```

Returns a map from schema type to property paths to be used for projection.

If the map is empty, then all properties will be retrieved for all results.

Calling this function repeatedly is inefficient. Prefer to retain the Map returned by this function, rather than calling it multiple times.

### getProjections

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

```
public @NonNull Map<String, List<String>> getProjections()
```

Returns a map from schema type to property paths to be used for projection.

If the map is empty, then all properties will be retrieved for all results.

Calling this function repeatedly is inefficient. Prefer to retain the Map returned by this function, rather than calling it multiple times.