SearchAction.Builder


@Document.BuilderProducer
public final class SearchAction.Builder extends SearchAction.BuilderBase


Builder for SearchAction.

Summary

Public constructors

Builder(@NonNull SearchAction searchAction)

Constructor for SearchAction.Builder with all the existing values.

Builder(
    @NonNull String namespace,
    @NonNull String id,
    long actionTimestampMillis
)

Constructor for SearchAction.Builder.

Inherited methods

From androidx.appsearch.usagereporting.SearchAction.BuilderBase
@NonNull SearchAction

Builds a SearchAction.

@NonNull T
setFetchedResultCount(int fetchedResultCount)

Sets total number of results fetched from AppSearch by the client in this SearchAction.

@NonNull T

Sets the user-entered search input (without any operators or rewriting).

From androidx.appsearch.usagereporting.TakenAction.BuilderBase
@NonNull TakenAction

For AppSearch annotation processor requirement only.

@NonNull T
setDocumentTtlMillis(long documentTtlMillis)

Sets the time-to-live (TTL) of the TakenAction document as a duration in milliseconds.

Public constructors

Builder

Added in 1.1.0
public Builder(@NonNull SearchAction searchAction)

Constructor for SearchAction.Builder with all the existing values.

Builder

Added in 1.1.0
public Builder(
    @NonNull String namespace,
    @NonNull String id,
    long actionTimestampMillis
)

Constructor for SearchAction.Builder.

Parameters
@NonNull String namespace

Namespace for the Document. See Document.Namespace.

@NonNull String id

Unique identifier for the Document. See Document.Id.

long actionTimestampMillis

The timestamp when the user took the action, in milliseconds since Unix epoch.