SearchAction.BuilderBase


@ExperimentalAppSearchApi
class SearchAction.BuilderBase<T : SearchAction.BuilderBase<T!>?> : TakenAction.BuilderBase

Known direct subclasses

Builder for SearchAction.

Summary

Public constructors

BuilderBase(searchAction: SearchAction)

Constructor for SearchAction.BuilderBase with all the existing values.

BuilderBase(namespace: String, id: String, actionTimestampMillis: Long)

Constructs SearchAction.BuilderBase with given namespace, id, and actionTimestampMillis.

BuilderBase(
    namespace: String,
    id: String,
    actionTimestampMillis: Long,
    actionType: Int
)

Constructs SearchAction.BuilderBase with given namespace, id, actionTimestampMillis and actionType.

Public functions

SearchAction

Builds a SearchAction.

T
setFetchedResultCount(fetchedResultCount: Int)

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

T
setQuery(query: String?)

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

Inherited functions

From androidx.appsearch.usagereporting.TakenAction.BuilderBase
T
setDocumentTtlMillis(documentTtlMillis: Long)

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

Public constructors

BuilderBase

Added in 1.2.0-alpha02
BuilderBase(searchAction: SearchAction)

Constructor for SearchAction.BuilderBase with all the existing values.

BuilderBase

Added in 1.2.0-alpha02
BuilderBase(namespace: String, id: String, actionTimestampMillis: Long)

Constructs SearchAction.BuilderBase with given namespace, id, and actionTimestampMillis.

The TakenAction.ActionType for the Document returned from getActionType will be ACTION_TYPE_SEARCH.

Parameters
namespace: String

Namespace for the Document. See Document.Namespace.

id: String

Unique identifier for the Document. See Document.Id.

actionTimestampMillis: Long

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

BuilderBase

BuilderBase(
    namespace: String,
    id: String,
    actionTimestampMillis: Long,
    actionType: Int
)

Constructs SearchAction.BuilderBase with given namespace, id, actionTimestampMillis and actionType.

Parameters
namespace: String

Namespace for the Document. See Document.Namespace.

id: String

Unique identifier for the Document. See Document.Id.

actionTimestampMillis: Long

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

actionType: Int

Action type enum for the Document. See TakenAction.ActionType.

Public functions

build

fun build(): SearchAction

Builds a SearchAction.

setFetchedResultCount

Added in 1.2.0-alpha02
fun setFetchedResultCount(fetchedResultCount: Int): T

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

setQuery

Added in 1.2.0-alpha02
fun setQuery(query: String?): T

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