public final class

SearchActionGenericDocument.Builder

extends androidx.appsearch.localstorage.usagereporting.TakenActionGenericDocument.Builder<SearchActionGenericDocument.Builder>

 java.lang.Object

androidx.appsearch.app.GenericDocument.Builder<androidx.appsearch.localstorage.usagereporting.TakenActionGenericDocument.Builder>

↳androidx.appsearch.localstorage.usagereporting.TakenActionGenericDocument.Builder<SearchActionGenericDocument.Builder>

↳androidx.appsearch.localstorage.usagereporting.SearchActionGenericDocument.Builder

Overview

Builder for SearchActionGenericDocument.

Summary

Constructors
publicBuilder(GenericDocument document)

Creates a new SearchActionGenericDocument.Builder from an existing GenericDocument.

publicBuilder(java.lang.String namespace, java.lang.String id, java.lang.String schemaType)

Creates a new SearchActionGenericDocument.Builder.

Methods
public SearchActionGenericDocumentbuild()

Builds a SearchActionGenericDocument.

public SearchActionGenericDocument.BuildersetFetchedResultCount(int fetchedResultCount)

Sets the integer value of property fetchedResultCount by total number of results fetched from AppSearch by the client in this search action.

public SearchActionGenericDocument.BuildersetQuery(java.lang.String query)

Sets the string value of property query by the user-entered search input (without any operators or rewriting).

from GenericDocument.Builder<BuilderType>clearProperty, setCreationTimestampMillis, setId, setNamespace, setParentTypes, setPropertyBoolean, setPropertyBytes, setPropertyDocument, setPropertyDouble, setPropertyEmbedding, setPropertyLong, setPropertyString, setSchemaType, setScore, setTtlMillis
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(java.lang.String namespace, java.lang.String id, java.lang.String schemaType)

Creates a new SearchActionGenericDocument.Builder.

Document IDs are unique within a namespace.

The number of namespaces per app should be kept small for efficiency reasons.

Parameters:

namespace: the namespace to set for the GenericDocument.
id: the unique identifier for the GenericDocument in its namespace.
schemaType: the AppSearchSchema type of the GenericDocument. The provided schemaType must be defined using AppSearchSession.setSchemaAsync(SetSchemaRequest) prior to inserting a document of this schemaType into the AppSearch index using AppSearchSession.putAsync(PutDocumentsRequest). Otherwise, the document will be rejected by AppSearchSession.putAsync(PutDocumentsRequest) with result code AppSearchResult.RESULT_NOT_FOUND.

public Builder(GenericDocument document)

Creates a new SearchActionGenericDocument.Builder from an existing GenericDocument.

Parameters:

document: a generic document object.

Methods

public SearchActionGenericDocument.Builder setQuery(java.lang.String query)

Sets the string value of property query by the user-entered search input (without any operators or rewriting).

public SearchActionGenericDocument.Builder setFetchedResultCount(int fetchedResultCount)

Sets the integer value of property fetchedResultCount by total number of results fetched from AppSearch by the client in this search action.

Builds a SearchActionGenericDocument.