AppSearchSchema.StringPropertyConfig


public final class AppSearchSchema.StringPropertyConfig extends AppSearchSchema.PropertyConfig


Configuration for a property of type String in a Document.

Summary

Nested types

Builder for StringPropertyConfig.

Constants

static final int

Does not propagate deletion.

static final int
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features .SCHEMA_STRING_PROPERTY_CONFIG_DELETE_PROPAGATION_TYPE_PROPAGATE_FROM)
@ExperimentalAppSearchApi
DELETE_PROPAGATION_TYPE_PROPAGATE_FROM = 1

Content in this string property will be used as a qualified id referring to another (parent) document, and the deletion of the referenced document will propagate to this (child) document.

static final int

Content in this property should only be returned for queries matching the exact tokens appearing in this property.

static final int

Content in this property will not be tokenized or indexed.

static final int

Content in this property should be returned for queries that are either exact matches or query matches of the tokens appearing in this property.

static final int

Content in this property is not joinable.

static final int
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.JOIN_SPEC_AND_QUALIFIED_ID)
JOINABLE_VALUE_TYPE_QUALIFIED_ID = 1

Content in this string property will be used as a qualified id to join documents.

static final int

This value indicates that no tokens should be extracted from this property.

static final int

Tokenization for plain text.

static final int
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.TOKENIZER_TYPE_RFC822)
TOKENIZER_TYPE_RFC822 = 3

Tokenization for emails.

static final int
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.VERBATIM_SEARCH)
TOKENIZER_TYPE_VERBATIM = 2

This value indicates that no normalization or segmentation should be applied to string values that are tokenized using this type.

Public methods

int

Returns how the deletion will be propagated between this document and the referenced document whose qualified id is held by this property.

int

Returns how the property is indexed.

int

Returns how this property is going to be used to join documents from other schema types.

int

Returns how this property is tokenized (split into words).

Inherited Constants

From androidx.appsearch.app.AppSearchSchema.PropertyConfig
static final int

Zero or one value [0,1].

static final int

Any number of items (including zero) [0...*].

static final int

Exactly one value [1].

Inherited methods

From androidx.appsearch.app.AppSearchSchema.PropertyConfig
boolean
int

Returns the cardinality of the property (whether it is optional, required or repeated).

@NonNull String

Returns a natural language description of this property.

@NonNull String

Returns the name of this property.

int
@NonNull String

Constants

DELETE_PROPAGATION_TYPE_NONE

Added in 1.1.0-alpha07
@ExperimentalAppSearchApi
public static final int DELETE_PROPAGATION_TYPE_NONE = 0

Does not propagate deletion.

DELETE_PROPAGATION_TYPE_PROPAGATE_FROM

Added in 1.1.0-alpha07
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features
                        .SCHEMA_STRING_PROPERTY_CONFIG_DELETE_PROPAGATION_TYPE_PROPAGATE_FROM)
@ExperimentalAppSearchApi
public static final int DELETE_PROPAGATION_TYPE_PROPAGATE_FROM = 1

Content in this string property will be used as a qualified id referring to another (parent) document, and the deletion of the referenced document will propagate to this (child) document.

Please note that this propagates further. If the child document has any children that also set delete propagation type PROPAGATE_FROM for their joinable properties, then those (grandchild) documents will be deleted.

Since delete propagation works between the document and the referenced document, if setting this type for delete propagation, the string property should also be qualified id joinable (i.e. having JOINABLE_VALUE_TYPE_QUALIFIED_ID for the joinable value type). Otherwise, throw IllegalStateException when building (see build).

INDEXING_TYPE_EXACT_TERMS

Added in 1.1.0-alpha07
public static final int INDEXING_TYPE_EXACT_TERMS = 1

Content in this property should only be returned for queries matching the exact tokens appearing in this property.

For example, a property with "fool" should NOT match a query for "foo".

INDEXING_TYPE_NONE

Added in 1.1.0-alpha07
public static final int INDEXING_TYPE_NONE = 0

Content in this property will not be tokenized or indexed.

INDEXING_TYPE_PREFIXES

Added in 1.1.0-alpha07
public static final int INDEXING_TYPE_PREFIXES = 2

Content in this property should be returned for queries that are either exact matches or query matches of the tokens appearing in this property.

For example, a property with "fool" should match a query for "foo".

JOINABLE_VALUE_TYPE_NONE

Added in 1.1.0-alpha07
public static final int JOINABLE_VALUE_TYPE_NONE = 0

Content in this property is not joinable.

JOINABLE_VALUE_TYPE_QUALIFIED_ID

Added in 1.1.0-alpha07
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.JOIN_SPEC_AND_QUALIFIED_ID)
public static final int JOINABLE_VALUE_TYPE_QUALIFIED_ID = 1

Content in this string property will be used as a qualified id to join documents.

TOKENIZER_TYPE_NONE

Added in 1.1.0-alpha07
public static final int TOKENIZER_TYPE_NONE = 0

This value indicates that no tokens should be extracted from this property.

It is only valid for tokenizer_type to be 'NONE' if getIndexingType is INDEXING_TYPE_NONE.

TOKENIZER_TYPE_PLAIN

Added in 1.1.0-alpha07
public static final int TOKENIZER_TYPE_PLAIN = 1

Tokenization for plain text. This value indicates that tokens should be extracted from this property based on word breaks. Segments of whitespace and punctuation are not considered tokens.

For example, a property with "foo bar. baz." will produce tokens for "foo", "bar" and "baz". The segments " " and "." will not be considered tokens.

It is only valid for tokenizer_type to be 'PLAIN' if getIndexingType is INDEXING_TYPE_EXACT_TERMS or INDEXING_TYPE_PREFIXES.

TOKENIZER_TYPE_RFC822

Added in 1.1.0-alpha07
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.TOKENIZER_TYPE_RFC822)
public static final int TOKENIZER_TYPE_RFC822 = 3

Tokenization for emails. This value indicates that tokens should be extracted from this property based on email structure.

For example, a property with "alex.sav@google.com" will produce tokens for "alex", "sav", "alex.sav", "google", "com", and "alexsav@google.com"

It is only valid for tokenizer_type to be 'RFC822' if getIndexingType is INDEXING_TYPE_EXACT_TERMS or INDEXING_TYPE_PREFIXES.

TOKENIZER_TYPE_VERBATIM

Added in 1.1.0-alpha07
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.VERBATIM_SEARCH)
public static final int TOKENIZER_TYPE_VERBATIM = 2

This value indicates that no normalization or segmentation should be applied to string values that are tokenized using this type. Therefore, the output token is equivalent to the raw string value.

For example, a property with "Hello, world!" will produce the token "Hello, world!", preserving punctuation and capitalization, and not creating separate tokens between the space.

It is only valid for tokenizer_type to be 'VERBATIM' if getIndexingType is INDEXING_TYPE_EXACT_TERMS or INDEXING_TYPE_PREFIXES.

Public methods

getDeletePropagationType

Added in 1.1.0-alpha07
@ExperimentalAppSearchApi
public int getDeletePropagationType()

Returns how the deletion will be propagated between this document and the referenced document whose qualified id is held by this property.

getIndexingType

Added in 1.1.0-alpha07
public int getIndexingType()

Returns how the property is indexed.

getJoinableValueType

Added in 1.1.0-alpha07
public int getJoinableValueType()

Returns how this property is going to be used to join documents from other schema types.

getTokenizerType

Added in 1.1.0-alpha07
public int getTokenizerType()

Returns how this property is tokenized (split into words).