Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder : GenericDocument.Builder<AppSearchAccount.Builder!>
The builder class for AppSearchAccount.
Summary
| Inherited functions |
From class Builder
BuilderType |
clearProperty(name: String)
Clears the value for the property with the given name.
Note that this method does not support property paths.
You should check for the existence of the property in getPropertyNames if you need to make sure the property being cleared actually exists.
If the string passed is an invalid or nonexistent property, no error message or behavior will be observed.
|
BuilderType |
setCreationTimestampMillis(creationTimestampMillis: Long)
Sets the creation timestamp of the GenericDocument, in milliseconds.
This should be set using a value obtained from the System.currentTimeMillis time base.
If this method is not called, this will be set to the time the object is built.
|
BuilderType |
setId(id: String)
Sets the ID of this document, changing the value provided in the constructor. No special values are reserved or understood by the infrastructure.
Document IDs are unique within the combination of package, database, and namespace.
Setting a document with a duplicate id will overwrite the original document with the new document, enforcing uniqueness within the above constraint.
|
BuilderType |
setNamespace(namespace: String)
Sets the app-defined namespace this document resides in, changing the value provided in the constructor. No special values are reserved or understood by the infrastructure.
Document IDs are unique within a namespace.
The number of namespaces per app should be kept small for efficiency reasons.
|
BuilderType |
setPropertyBlobHandle(name: String, vararg values: AppSearchBlobHandle!)
Sets one or multiple AppSearchBlobHandle values for a property, replacing its previous values.
AppSearchBlobHandle is a pointer to a blob of data.
Store large byte via the android.os.ParcelFileDescriptor returned from AppSearchSession.openBlobForWrite. Once the blob data is committed via AppSearchSession.commitBlob, the blob is retrievable via AppSearchSession.openBlobForRead.
|
BuilderType |
setPropertyBoolean(name: String, vararg values: Boolean)
Sets one or multiple boolean values for a property, replacing its previous values.
|
BuilderType |
setPropertyBytes(name: String, vararg values: ByteArray!)
Sets one or multiple byte[] for a property, replacing its previous values.
For large byte data and lazy retrieval, see setPropertyBlobHandle.
|
BuilderType |
setPropertyDocument(name: String, vararg values: GenericDocument!)
Sets one or multiple GenericDocument values for a property, replacing its previous values.
|
BuilderType |
setPropertyDouble(name: String, vararg values: Double)
Sets one or multiple double values for a property, replacing its previous values.
|
BuilderType |
setPropertyEmbedding(name: String, vararg values: EmbeddingVector!)
Sets one or multiple EmbeddingVector values for a property, replacing its previous values.
|
BuilderType |
setPropertyLong(name: String, vararg values: Long)
Sets one or multiple long values for a property, replacing its previous values.
|
BuilderType |
setPropertyString(name: String, vararg values: String!)
Sets one or multiple String values for a property, replacing its previous values.
|
BuilderType |
setSchemaType(schemaType: String)
Sets the schema type of this document, changing the value provided in the constructor.
To successfully index a document, the schema type must match the name of an AppSearchSchema object previously provided to AppSearchSession.setSchema.
|
BuilderType |
setScore(score: Int)
Sets the score of the GenericDocument.
The score is a query-independent measure of the document's quality, relative to other GenericDocument objects of the same AppSearchSchema type.
Results may be sorted by score using android.app.appsearch.SearchSpec.Builder#setRankingStrategy. Documents with higher scores are considered better than documents with lower scores.
Any non-negative integer can be used a score. By default, scores are set to 0.
|
BuilderType |
setTtlMillis(ttlMillis: Long)
Sets the TTL (time-to-live) of the GenericDocument, in milliseconds.
The TTL is measured against getCreationTimestampMillis. At the timestamp of creationTimestampMillis + ttlMillis, measured in the System.currentTimeMillis time base, the document will be auto-deleted.
The default value is 0, which means the document is permanent and won't be auto-deleted until the app is uninstalled or android.app.appsearch.AppSearchSession#remove is called.
|
|
Public constructors
Builder
Builder(
namespace: String,
id: String)
Creates a new AppSearchAccount.Builder
| Parameters |
namespace |
String: The namespace of the account. This value cannot be null. |
id |
String: The document ID of the account. This value cannot be null. |
Public methods
setAccountType
fun setAccountType(accountType: String): AppSearchAccount.Builder
Sets the type of AppSearchAccount.
| Parameters |
accountType |
String: The non-null, unique identifier for the account service. This must correspond to a registered Authenticator type on the system. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-03-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-03-26 UTC."],[],[]]