AppSearchBatchResult

class AppSearchBatchResult<KeyType, ValueType>


Provides results for AppSearch batch operations which encompass multiple documents.

Individual results of a batch operation are separated into two maps: one for successes and one for failures. For successes, getSuccesses will return a map of keys to instances of the value type. For failures, getFailures will return a map of keys to AppSearchResult objects.

Alternatively, getAll returns a map of keys to AppSearchResult objects for both successes and failures.

Parameters
<KeyType>

The type of the keys for which the results will be reported.

<ValueType>

The type of the result objects for successful results.

Summary

Nested types

class AppSearchBatchResult.Builder<KeyType, ValueType>

Builder for AppSearchBatchResult objects.

Public functions

(Mutable)Map<KeyType!, AppSearchResult<ValueType!>!>

Returns a Map of keys mapped to instances of AppSearchResult for all individual results.

(Mutable)Map<KeyType!, AppSearchResult<ValueType!>!>

Returns a Map of keys mapped to instances of AppSearchResult for all failed individual results.

(Mutable)Map<KeyType!, ValueType!>

Returns a Map of keys mapped to instances of the value type for all successful individual results.

Boolean

Returns true if this AppSearchBatchResult has no failures.

String

Public functions

getAll

Added in 1.1.0-alpha04
fun getAll(): (Mutable)Map<KeyType!, AppSearchResult<ValueType!>!>

Returns a Map of keys mapped to instances of AppSearchResult for all individual results.

The values of the Map will not be null.

getFailures

Added in 1.1.0-alpha04
fun getFailures(): (Mutable)Map<KeyType!, AppSearchResult<ValueType!>!>

Returns a Map of keys mapped to instances of AppSearchResult for all failed individual results.

The values of the Map will not be null.

getSuccesses

Added in 1.1.0-alpha04
fun getSuccesses(): (Mutable)Map<KeyType!, ValueType!>

Returns a Map of keys mapped to instances of the value type for all successful individual results.

Example: getByDocumentIdAsync returns an AppSearchBatchResult. Each key (the document ID, of String type) will map to a GenericDocument object.

The values of the Map will not be null.

isSuccess

Added in 1.1.0-alpha04
fun isSuccess(): Boolean

Returns true if this AppSearchBatchResult has no failures.

toString

fun toString(): String