EnterpriseGlobalSearchSession


@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ENTERPRISE_GLOBAL_SEARCH_SESSION)
interface EnterpriseGlobalSearchSession : ReadOnlyGlobalSearchSession


Provides a connection to all enterprise (work profile) AppSearch databases the querying application has been granted access to.

This session can be created from any user profile but will only properly return results when created from the main profile. If the user is not the main profile or an associated work profile does not exist, queries will still successfully complete but with empty results.

Schemas must be explicitly tagged enterprise and may require additional permissions to be visible from an enterprise session. Retrieved documents may also have certain fields restricted or modified unlike if they were retrieved directly from GlobalSearchSession on the work profile.

All implementations of this interface must be thread safe.

Summary

Inherited functions

From androidx.appsearch.app.ReadOnlyGlobalSearchSession
ListenableFuture<AppSearchBatchResult<String!, GenericDocument!>!>
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.GLOBAL_SEARCH_SESSION_GET_BY_ID)
getByDocumentIdAsync(
    packageName: String,
    databaseName: String,
    request: GetByDocumentIdRequest
)

Retrieves GenericDocument documents, belonging to the specified package name and database name and identified by the namespace and ids in the request, from the GlobalSearchSession database.

Features

Returns the Features to check for the availability of certain features for this session.

ListenableFuture<GetSchemaResponse!>
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.GLOBAL_SEARCH_SESSION_GET_SCHEMA)
getSchemaAsync(packageName: String, databaseName: String)

Retrieves the collection of schemas most recently successfully provided to setSchemaAsync for any types belonging to the requested package and database that the caller has been granted access to.

SearchResults
search(queryExpression: String, searchSpec: SearchSpec)

Retrieves documents from all AppSearch databases that the querying application has access to.