SearchAction.Builder


@Document.BuilderProducer
class SearchAction.Builder


Builder for SearchAction.

Summary

Public constructors

Builder(searchAction: SearchAction)

Constructor for Builder with all the existing values.

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

Constructor for SearchAction.Builder.

Public functions

SearchAction

Builds a SearchAction.

T
setDocumentTtlMillis(documentTtlMillis: Long)

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

SearchAction.Builder
setFetchedResultCount(fetchedResultCount: Int)

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

SearchAction.Builder
setQuery(query: String?)

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

Public constructors

Builder

Added in 1.1.0-alpha07
Builder(searchAction: SearchAction)

Constructor for Builder with all the existing values.

Builder

Added in 1.1.0-alpha07
Builder(namespace: String, id: String, actionTimestampMillis: Long)

Constructor for SearchAction.Builder.

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.

Public functions

build

Added in 1.1.0-alpha07
fun build(): SearchAction

Builds a SearchAction.

setDocumentTtlMillis

Added in 1.1.0-alpha07
fun setDocumentTtlMillis(documentTtlMillis: Long): T

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

Added in 1.1.0-alpha07
fun setFetchedResultCount(fetchedResultCount: Int): SearchAction.Builder

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

setQuery

Added in 1.1.0-alpha07
fun setQuery(query: String?): SearchAction.Builder

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

Protected properties

mActionTimestampMillis

protected val mActionTimestampMillisLong

mActionType

protected val mActionTypeInt

mDocumentTtlMillis

protected val mDocumentTtlMillisLong

mId

protected val mIdString!

mNamespace

protected val mNamespaceString!