EnterpriseGlobalSearchSession


@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ENTERPRISE_GLOBAL_SEARCH_SESSION)
public interface EnterpriseGlobalSearchSession extends 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 methods

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

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.

abstract @NonNull Features

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

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

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.

abstract @NonNull SearchResults
search(@NonNull String queryExpression, @NonNull SearchSpec searchSpec)

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