interface Features


A class that encapsulates all features that are only supported in certain cases (e.g. only on certain implementations or only at a certain Android API Level).

Features do not depend on any runtime state, and features will never be removed. Once isFeatureSupported returns true for a certain feature, it is safe to assume that the feature will be available forever on that AppSearch storage implementation, at that Android API level, on that device.

Summary

Constants

const String!
ADD_PERMISSIONS_AND_GET_VISIBILITY = "ADD_PERMISSIONS_AND_GET_VISIBILITY"

Feature for isFeatureSupported.

const String!
ENTERPRISE_GLOBAL_SEARCH_SESSION = "ENTERPRISE_GLOBAL_SEARCH_SESSION"

Feature for isFeatureSupported.

const String!
GLOBAL_SEARCH_SESSION_GET_BY_ID = "GLOBAL_SEARCH_SESSION_GET_BY_ID"

Feature for isFeatureSupported.

const String!
GLOBAL_SEARCH_SESSION_GET_SCHEMA = "GLOBAL_SEARCH_SESSION_GET_SCHEMA"

Feature for isFeatureSupported.

const String!
GLOBAL_SEARCH_SESSION_REGISTER_OBSERVER_CALLBACK = "GLOBAL_SEARCH_SESSION_REGISTER_OBSERVER_CALLBACK"

Feature for isFeatureSupported.

const String!

Feature for isFeatureSupported.

const String!
JOIN_SPEC_AND_QUALIFIED_ID = "JOIN_SPEC_AND_QUALIFIED_ID"

Feature for isFeatureSupported.

const String!
LIST_FILTER_HAS_PROPERTY_FUNCTION = "LIST_FILTER_HAS_PROPERTY_FUNCTION"

Feature for isFeatureSupported.

const String!
@ExperimentalAppSearchApi
LIST_FILTER_MATCH_SCORE_EXPRESSION_FUNCTION = "LIST_FILTER_MATCH_SCORE_EXPRESSION_FUNCTION"

Feature for isFeatureSupported.

const String!
LIST_FILTER_QUERY_LANGUAGE = "LIST_FILTER_QUERY_LANGUAGE"

Feature for isFeatureSupported.

const String!
NUMERIC_SEARCH = "NUMERIC_SEARCH"

Feature for isFeatureSupported.

const String!
SCHEMA_ADD_INDEXABLE_NESTED_PROPERTIES = "SCHEMA_ADD_INDEXABLE_NESTED_PROPERTIES"

Feature for isFeatureSupported.

const String!
SCHEMA_ADD_PARENT_TYPE = "SCHEMA_ADD_PARENT_TYPE"

Feature for isFeatureSupported.

const String!
SCHEMA_EMBEDDING_PROPERTY_CONFIG = "SCHEMA_EMBEDDING_PROPERTY_CONFIG"

Feature for isFeatureSupported.

const String!

Feature for isFeatureSupported.

const String!
@ExperimentalAppSearchApi
SCHEMA_SCORABLE_PROPERTY_CONFIG = "SCHEMA_SCORABLE_PROPERTY_CONFIG"

Feature for isFeatureSupported.

const String!

Feature for isFeatureSupported.

const String!
@ExperimentalAppSearchApi
SCHEMA_STRING_PROPERTY_CONFIG_DELETE_PROPAGATION_TYPE_PROPAGATE_FROM = "SCHEMA_STRING_PROPERTY_CONFIG_DELETE_PROPAGATION_TYPE_PROPAGATE_FROM"

Feature for isFeatureSupported.

const String!
SEARCH_RESULT_MATCH_INFO_SUBMATCH = "SEARCH_RESULT_MATCH_INFO_SUBMATCH"

Feature for isFeatureSupported.

const String!

Feature for isFeatureSupported.

const String!
@ExperimentalAppSearchApi
SEARCH_SPEC_ADD_FILTER_DOCUMENT_IDS = "SEARCH_SPEC_ADD_FILTER_DOCUMENT_IDS"

Feature for isFeatureSupported.

const String!
SEARCH_SPEC_ADD_FILTER_PROPERTIES = "SEARCH_SPEC_ADD_FILTER_PROPERTIES"

Feature for isFeatureSupported.

const String!
SEARCH_SPEC_ADD_INFORMATIONAL_RANKING_EXPRESSIONS = "SEARCH_SPEC_ADD_INFORMATIONAL_RANKING_EXPRESSIONS"

Feature for isFeatureSupported.

const String!
SEARCH_SPEC_ADVANCED_RANKING_EXPRESSION = "SEARCH_SPEC_ADVANCED_RANKING_EXPRESSION"

Feature for isFeatureSupported.

const String!
SEARCH_SPEC_GROUPING_TYPE_PER_SCHEMA = "SEARCH_SPEC_GROUPING_TYPE_PER_SCHEMA"

Feature for isFeatureSupported.

const String!
SEARCH_SPEC_PROPERTY_WEIGHTS = "SEARCH_SPEC_PROPERTY_WEIGHTS"

Feature for isFeatureSupported.

const String!
SEARCH_SPEC_SEARCH_STRING_PARAMETERS = "SEARCH_SPEC_SEARCH_STRING_PARAMETERS"

Feature for isFeatureSupported.

const String!
SEARCH_SPEC_SET_SEARCH_SOURCE_LOG_TAG = "SEARCH_SPEC_SET_SEARCH_SOURCE_LOG_TAG"

Feature for isFeatureSupported.

const String!
SEARCH_SUGGESTION = "SEARCH_SUGGESTION"

Feature for isFeatureSupported.

const String!
SET_SCHEMA_CIRCULAR_REFERENCES = "SET_SCHEMA_CIRCULAR_REFERENCES"

Feature for isFeatureSupported.

const String!
SET_SCHEMA_REQUEST_ADD_SCHEMA_TYPE_VISIBLE_TO_CONFIG = "SET_SCHEMA_REQUEST_ADD_SCHEMA_TYPE_VISIBLE_TO_CONFIG"

Feature for isFeatureSupported.

const String!
SET_SCHEMA_REQUEST_SET_PUBLICLY_VISIBLE = "SET_SCHEMA_REQUEST_SET_PUBLICLY_VISIBLE"

Feature for isFeatureSupported.

const String!
TOKENIZER_TYPE_RFC822 = "TOKENIZER_TYPE_RFC822"

Feature for isFeatureSupported.

const String!
VERBATIM_SEARCH = "VERBATIM_SEARCH"

Feature for isFeatureSupported.

Public functions

Int

Returns the maximum amount of properties that can be indexed in a Document given the Android API level and AppSearch backend.

Boolean

Returns whether a feature is supported at run-time.

Constants

ENTERPRISE_GLOBAL_SEARCH_SESSION

Added in 1.1.0-alpha07
const val ENTERPRISE_GLOBAL_SEARCH_SESSION = "ENTERPRISE_GLOBAL_SEARCH_SESSION": String!

Feature for isFeatureSupported. This feature covers EnterpriseGlobalSearchSession

GLOBAL_SEARCH_SESSION_GET_BY_ID

Added in 1.1.0-alpha07
const val GLOBAL_SEARCH_SESSION_GET_BY_ID = "GLOBAL_SEARCH_SESSION_GET_BY_ID": String!

Feature for isFeatureSupported. This feature covers getByDocumentIdAsync.

GLOBAL_SEARCH_SESSION_GET_SCHEMA

Added in 1.1.0-alpha07
const val GLOBAL_SEARCH_SESSION_GET_SCHEMA = "GLOBAL_SEARCH_SESSION_GET_SCHEMA": String!

Feature for isFeatureSupported. This feature covers getSchemaAsync.

GLOBAL_SEARCH_SESSION_REGISTER_OBSERVER_CALLBACK

Added in 1.1.0-alpha07
const val GLOBAL_SEARCH_SESSION_REGISTER_OBSERVER_CALLBACK = "GLOBAL_SEARCH_SESSION_REGISTER_OBSERVER_CALLBACK": String!

Feature for isFeatureSupported. This feature covers registerObserverCallback and unregisterObserverCallback.

INDEXER_MOBILE_APPLICATIONS

Added in 1.1.0-alpha07
@ExperimentalAppSearchApi
const val INDEXER_MOBILE_APPLICATIONS = "INDEXER_MOBILE_APPLICATIONS": String!

Feature for isFeatureSupported. This feature indicates whether or not the MobileApplication corpus is being indexed.

This corpus contains documents representing applications installed on the device, and each document includes an icon uri, a package id, a display name, and nicknames of the app. This corpus may be queried by applications interested in querying for and launching applications, such as a search app. androidx.appsearch.builtintypes.MobileApplication can be used to parse documents returned from this corpus.

This corpus can be queried with a GlobalSearchSession, by filtering on the "android" package and the "apps" namespace, for example: globalSession.query("", new SearchSpec.Builder().addFilterPackageNames("android").addFilterNamespace("apps").build())

JOIN_SPEC_AND_QUALIFIED_ID

Added in 1.1.0-alpha07
const val JOIN_SPEC_AND_QUALIFIED_ID = "JOIN_SPEC_AND_QUALIFIED_ID": String!

Feature for isFeatureSupported. This feature covers JOINABLE_VALUE_TYPE_QUALIFIED_ID, setJoinSpec, and all other join features.

LIST_FILTER_HAS_PROPERTY_FUNCTION

Added in 1.1.0-alpha07
const val LIST_FILTER_HAS_PROPERTY_FUNCTION = "LIST_FILTER_HAS_PROPERTY_FUNCTION": String!

Feature for isFeatureSupported. This feature covers the use of the "hasProperty" function in query expressions.

For details on the "hasProperty" function in the query language, see search.

LIST_FILTER_MATCH_SCORE_EXPRESSION_FUNCTION

Added in 1.1.0-alpha07
@ExperimentalAppSearchApi
const val LIST_FILTER_MATCH_SCORE_EXPRESSION_FUNCTION = "LIST_FILTER_MATCH_SCORE_EXPRESSION_FUNCTION": String!

Feature for isFeatureSupported. This feature covers the use of the "matchScoreExpression" function in query expressions.

For details on the "matchScoreExpression" function in the query language, see search.

LIST_FILTER_QUERY_LANGUAGE

Added in 1.1.0-alpha07
const val LIST_FILTER_QUERY_LANGUAGE = "LIST_FILTER_QUERY_LANGUAGE": String!

Feature for isFeatureSupported. This feature covers the expansion of the query language to conform to the definition of the list filters language (https://aip.dev/160).

For more details, see search.

NUMERIC_SEARCH

Added in 1.1.0-alpha07
const val NUMERIC_SEARCH = "NUMERIC_SEARCH": String!

Feature for isFeatureSupported. This feature covers INDEXING_TYPE_RANGE and all other numeric search features.

For details on the numeric search expressions in the query language, see search.

SCHEMA_ADD_INDEXABLE_NESTED_PROPERTIES

Added in 1.1.0-alpha07
const val SCHEMA_ADD_INDEXABLE_NESTED_PROPERTIES = "SCHEMA_ADD_INDEXABLE_NESTED_PROPERTIES": String!

Feature for isFeatureSupported. This feature covers addIndexableNestedProperties

SCHEMA_ADD_PARENT_TYPE

Added in 1.1.0-alpha07
const val SCHEMA_ADD_PARENT_TYPE = "SCHEMA_ADD_PARENT_TYPE": String!

Feature for isFeatureSupported. This feature covers addParentType.

SCHEMA_EMBEDDING_PROPERTY_CONFIG

Added in 1.1.0-alpha07
const val SCHEMA_EMBEDDING_PROPERTY_CONFIG = "SCHEMA_EMBEDDING_PROPERTY_CONFIG": String!

Feature for isFeatureSupported. This feature covers AppSearchSchema.EmbeddingPropertyConfig.

For details on the embedding search expressions, see search for the query language and setRankingStrategy for the ranking language.

SCHEMA_EMBEDDING_QUANTIZATION

Added in 1.1.0-alpha07
@ExperimentalAppSearchApi
const val SCHEMA_EMBEDDING_QUANTIZATION = "SCHEMA_EMBEDDING_QUANTIZATION": String!

Feature for isFeatureSupported. This feature covers setQuantizationType.

SCHEMA_SCORABLE_PROPERTY_CONFIG

Added in 1.1.0-alpha07
@ExperimentalAppSearchApi
const val SCHEMA_SCORABLE_PROPERTY_CONFIG = "SCHEMA_SCORABLE_PROPERTY_CONFIG": String!

Feature for isFeatureSupported. This feature covers setScoringEnabled, setScoringEnabled, setScoringEnabled. setScorablePropertyRankingEnabled.

SCHEMA_SET_DESCRIPTION

Added in 1.1.0-alpha07
@ExperimentalAppSearchApi
const val SCHEMA_SET_DESCRIPTION = "SCHEMA_SET_DESCRIPTION": String!

Feature for isFeatureSupported. This feature covers whether or not the AppSearch backend can store the descriptions returned by getDescription and getDescription.

SCHEMA_STRING_PROPERTY_CONFIG_DELETE_PROPAGATION_TYPE_PROPAGATE_FROM

Added in 1.1.0-alpha07
@ExperimentalAppSearchApi
const val SCHEMA_STRING_PROPERTY_CONFIG_DELETE_PROPAGATION_TYPE_PROPAGATE_FROM = "SCHEMA_STRING_PROPERTY_CONFIG_DELETE_PROPAGATION_TYPE_PROPAGATE_FROM": String!

Feature for isFeatureSupported. This feature covers DELETE_PROPAGATION_TYPE_PROPAGATE_FROM and setDeletePropagationType.

SEARCH_RESULT_MATCH_INFO_SUBMATCH

Added in 1.1.0-alpha07
const val SEARCH_RESULT_MATCH_INFO_SUBMATCH = "SEARCH_RESULT_MATCH_INFO_SUBMATCH": String!

Feature for isFeatureSupported. This feature covers getSubmatchRange and getSubmatch.

SEARCH_RESULT_PARENT_TYPES

Added in 1.1.0-alpha07
@ExperimentalAppSearchApi
const val SEARCH_RESULT_PARENT_TYPES = "SEARCH_RESULT_PARENT_TYPES": String!

Feature for isFeatureSupported. This feature covers whether to wrap the parent types of a document in the corresponding androidx.appsearch.app.SearchResult, instead of in androidx.appsearch.app.GenericDocument.

SEARCH_SPEC_ADD_FILTER_DOCUMENT_IDS

Added in 1.1.0-alpha07
@ExperimentalAppSearchApi
const val SEARCH_SPEC_ADD_FILTER_DOCUMENT_IDS = "SEARCH_SPEC_ADD_FILTER_DOCUMENT_IDS": String!

Feature for isFeatureSupported. This feature covers addFilterDocumentIds.

SEARCH_SPEC_ADD_FILTER_PROPERTIES

Added in 1.1.0-alpha07
const val SEARCH_SPEC_ADD_FILTER_PROPERTIES = "SEARCH_SPEC_ADD_FILTER_PROPERTIES": String!

Feature for isFeatureSupported. This feature covers addFilterProperties and addFilterProperties.

SEARCH_SPEC_ADD_INFORMATIONAL_RANKING_EXPRESSIONS

Added in 1.1.0-alpha07
const val SEARCH_SPEC_ADD_INFORMATIONAL_RANKING_EXPRESSIONS = "SEARCH_SPEC_ADD_INFORMATIONAL_RANKING_EXPRESSIONS": String!

Feature for isFeatureSupported. This feature covers addInformationalRankingExpressions.

SEARCH_SPEC_ADVANCED_RANKING_EXPRESSION

Added in 1.1.0-alpha07
const val SEARCH_SPEC_ADVANCED_RANKING_EXPRESSION = "SEARCH_SPEC_ADVANCED_RANKING_EXPRESSION": String!

Feature for isFeatureSupported. This feature covers setRankingStrategy.

SEARCH_SPEC_GROUPING_TYPE_PER_SCHEMA

Added in 1.1.0-alpha07
const val SEARCH_SPEC_GROUPING_TYPE_PER_SCHEMA = "SEARCH_SPEC_GROUPING_TYPE_PER_SCHEMA": String!

Feature for isFeatureSupported. This feature covers GROUPING_TYPE_PER_SCHEMA

SEARCH_SPEC_PROPERTY_WEIGHTS

Added in 1.1.0-alpha07
const val SEARCH_SPEC_PROPERTY_WEIGHTS = "SEARCH_SPEC_PROPERTY_WEIGHTS": String!

Feature for isFeatureSupported. This feature covers setPropertyWeights.

SEARCH_SPEC_SEARCH_STRING_PARAMETERS

Added in 1.1.0-alpha07
const val SEARCH_SPEC_SEARCH_STRING_PARAMETERS = "SEARCH_SPEC_SEARCH_STRING_PARAMETERS": String!

Feature for isFeatureSupported. This feature covers the support of the addSearchStringParameters and addSearchStringParameters apis.

SEARCH_SPEC_SET_SEARCH_SOURCE_LOG_TAG

Added in 1.1.0-alpha07
const val SEARCH_SPEC_SET_SEARCH_SOURCE_LOG_TAG = "SEARCH_SPEC_SET_SEARCH_SOURCE_LOG_TAG": String!

Feature for isFeatureSupported. This feature covers setSearchSourceLogTag.

SEARCH_SUGGESTION

Added in 1.1.0-alpha07
const val SEARCH_SUGGESTION = "SEARCH_SUGGESTION": String!

Feature for isFeatureSupported. This feature covers searchSuggestionAsync.

SET_SCHEMA_CIRCULAR_REFERENCES

Added in 1.1.0-alpha07
const val SET_SCHEMA_CIRCULAR_REFERENCES = "SET_SCHEMA_CIRCULAR_REFERENCES": String!

Feature for isFeatureSupported. This feature covers setting schemas with circular references for setSchemaAsync.

SET_SCHEMA_REQUEST_ADD_SCHEMA_TYPE_VISIBLE_TO_CONFIG

Added in 1.1.0-alpha07
const val SET_SCHEMA_REQUEST_ADD_SCHEMA_TYPE_VISIBLE_TO_CONFIG = "SET_SCHEMA_REQUEST_ADD_SCHEMA_TYPE_VISIBLE_TO_CONFIG": String!

Feature for isFeatureSupported. This feature covers addSchemaTypeVisibleToConfig.

SET_SCHEMA_REQUEST_SET_PUBLICLY_VISIBLE

Added in 1.1.0-alpha07
const val SET_SCHEMA_REQUEST_SET_PUBLICLY_VISIBLE = "SET_SCHEMA_REQUEST_SET_PUBLICLY_VISIBLE": String!

Feature for isFeatureSupported. This feature covers setPubliclyVisibleSchema.

TOKENIZER_TYPE_RFC822

Added in 1.1.0-alpha07
const val TOKENIZER_TYPE_RFC822 = "TOKENIZER_TYPE_RFC822": String!

Feature for isFeatureSupported. This feature covers TOKENIZER_TYPE_RFC822.

VERBATIM_SEARCH

Added in 1.1.0-alpha07
const val VERBATIM_SEARCH = "VERBATIM_SEARCH": String!

Feature for isFeatureSupported. This feature covers TOKENIZER_TYPE_VERBATIM and all other verbatim search features within the query language that allows clients to search using the verbatim string operator.

For details on the verbatim string operator, see search.

Public functions

getMaxIndexedProperties

Added in 1.1.0-alpha07
fun getMaxIndexedProperties(): Int

Returns the maximum amount of properties that can be indexed in a Document given the Android API level and AppSearch backend.

A property is defined as all values that are present at a particular path.

isFeatureSupported

Added in 1.1.0-alpha07
fun isFeatureSupported(feature: String): Boolean

Returns whether a feature is supported at run-time. Feature support depends on the feature in question, the AppSearch backend being used and the Android version of the device.

Note: If this method returns false, it is not safe to invoke the methods requiring the desired feature.

Parameters
feature: String

the feature to be checked

Returns
Boolean

whether the capability is supported given the Android API level and AppSearch backend.