SearchAction.Builder
@Document.BuilderProducer
public final class SearchAction.Builder
Builder for SearchAction.
Summary
Public constructors |
|---|
Builder(@NonNull SearchAction searchAction)Constructor for |
|
Constructor for |
Public methods |
|
|---|---|
@NonNull SearchAction |
build()Builds a |
@NonNull T |
setDocumentTtlMillis(long documentTtlMillis)Sets the time-to-live (TTL) of the |
@NonNull SearchAction.Builder |
setFetchedResultCount(int fetchedResultCount)Sets total number of results fetched from AppSearch by the client in this |
@NonNull SearchAction.Builder |
Sets the user-entered search input (without any operators or rewriting). |
Protected fields
Public constructors
Builder
public Builder(@NonNull SearchAction searchAction)
Constructor for Builder with all the existing values.
Builder
public Builder(
@NonNull String namespace,
@NonNull String id,
long actionTimestampMillis
)
Constructor for SearchAction.Builder.
| Parameters | |
|---|---|
@NonNull String namespace |
Namespace for the Document. See |
@NonNull String id |
Unique identifier for the Document. See |
long actionTimestampMillis |
The timestamp when the user took the action, in milliseconds since Unix epoch. |
Public methods
setDocumentTtlMillis
public @NonNull T setDocumentTtlMillis(long documentTtlMillis)
Sets the time-to-live (TTL) of the TakenAction document as a duration in milliseconds.
The document will be automatically deleted when the TTL expires (since getActionTimestampMillis).
The default TTL for TakenAction document is 60 days.
See androidx.appsearch.annotation.Document.TtlMillis for more information on TTL.
setFetchedResultCount
public @NonNull SearchAction.Builder setFetchedResultCount(int fetchedResultCount)
Sets total number of results fetched from AppSearch by the client in this SearchAction.
| See also | |
|---|---|
getFetchedResultCount |