# AppSearchSchema.StringPropertyConfig.Builder

Artifact: [androidx.appsearch:appsearch](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/app/AppSearchSchema.java+class:androidx.appsearch.app.AppSearchSchema.StringPropertyConfig.Builder) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
class AppSearchSchema.StringPropertyConfig.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig.Builder#Builder(java.lang.String)(propertyName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Creates a new `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig.Builder`. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig.Builder#build()()` Constructs a new `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig` from the contents of this builder. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig.Builder#setCardinality(int)(cardinality: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the cardinality of the property (whether it is optional, required or repeated). |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig.Builder` | `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig.Builder#setDeletePropagationType(int)(deletePropagationType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Configures how the deletion will be propagated between this document and the referenced document whose qualified id is held by this property. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig.Builder` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/kotlin/androidx/appsearch/app/Features.SCHEMA_SET_DESCRIPTION) @https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig.Builder#setDescription(java.lang.String)(description: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Sets a natural language description of this property. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig.Builder#setIndexingType(int)(indexingType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Configures how a property should be indexed so that it can be retrieved by queries. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig.Builder#setJoinableValueType(int)(joinableValueType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Configures how this property should be used as a joining matcher. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig.Builder#setTokenizerType(int)(tokenizerType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Configures how this property should be tokenized (split into words). |

## Public constructors

### Builder

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
Builder(propertyName: String)
```

Creates a new `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig.Builder`.

## Public functions

### build

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun build(): AppSearchSchema.StringPropertyConfig
```

Constructs a new `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig` from the contents of this builder.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | if any following condition: - Tokenizer type is not `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig#TOKENIZER_TYPE_NONE()` with indexing type `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig#INDEXING_TYPE_NONE()`. - Indexing type is not `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig#INDEXING_TYPE_NONE()` with tokenizer type `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig#TOKENIZER_TYPE_NONE()`. - Deletion type other than `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig#DELETE_PROPAGATION_TYPE_NONE()` is used without setting `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig#JOINABLE_VALUE_TYPE_QUALIFIED_ID()`. |

### setCardinality

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun setCardinality(cardinality: Int): AppSearchSchema.StringPropertyConfig.Builder
```

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

If this method is not called, the default cardinality is `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#CARDINALITY_OPTIONAL()`.

### setDeletePropagationType

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
@ExperimentalAppSearchApi
fun setDeletePropagationType(deletePropagationType: Int): AppSearchSchema.StringPropertyConfig.Builder
```

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

If this method is not called, the default delete propagation type is `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig#DELETE_PROPAGATION_TYPE_NONE()`, indicating that deletion will not propagate between this document and the referenced document.

If the delete propagation type is not `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig#DELETE_PROPAGATION_TYPE_NONE()`, then `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig#JOINABLE_VALUE_TYPE_QUALIFIED_ID()` must also be set since the delete propagation has to use the qualified id. Otherwise, throw `https://developer.android.com/reference/java/lang/IllegalStateException.html` when building.

### setDescription

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.SCHEMA_SET_DESCRIPTION)
@ExperimentalAppSearchApi
fun setDescription(description: String): AppSearchSchema.StringPropertyConfig.Builder
```

Sets a natural language description of this property.

For more details about the description field, see `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#getDescription()`.

### setIndexingType

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun setIndexingType(indexingType: Int): AppSearchSchema.StringPropertyConfig.Builder
```

Configures how a property should be indexed so that it can be retrieved by queries.

If this method is not called, the default indexing type is `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig#INDEXING_TYPE_NONE()`, so that it cannot be matched by queries.

### setJoinableValueType

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun setJoinableValueType(joinableValueType: Int): AppSearchSchema.StringPropertyConfig.Builder
```

Configures how this property should be used as a joining matcher.

If this method is not called, the default joinable value type is `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig#JOINABLE_VALUE_TYPE_NONE()`, so that it is not joinable.

At most, 64 properties can be set as joinable per schema.

Callers setting `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig#JOINABLE_VALUE_TYPE_QUALIFIED_ID()` with `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#CARDINALITY_REPEATED()` must retrieve `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSession#getFeatures()` and call `https://developer.android.com/reference/kotlin/androidx/appsearch/app/Features#isFeatureSupported(java.lang.String)` for `https://developer.android.com/reference/kotlin/androidx/appsearch/app/Features#SCHEMA_JOINABLE_REPEATED_PROPERTIES()`.

### setTokenizerType

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun setTokenizerType(tokenizerType: Int): AppSearchSchema.StringPropertyConfig.Builder
```

Configures how this property should be tokenized (split into words).

If this method is not called, the default indexing type is `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig#TOKENIZER_TYPE_NONE()`, so that it is not tokenized.

This method must be called with a value other than `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig#TOKENIZER_TYPE_NONE()` if the property is indexed (that is, if `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig.Builder#setIndexingType(int)` has been called with a value other than `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig#INDEXING_TYPE_NONE()`).