# AppSearchSchema.EmbeddingPropertyConfig.Builder

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 16](https://developer.android.com/sdkExtensions)

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder "View this page in Java")  

```
class Builder
```

|---|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                                                 ||
| ↳ | [android.app.appsearch.AppSearchSchema.EmbeddingPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder#) |

Builder for[EmbeddingPropertyConfig](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig).

## Summary

|                                                                                                                                                                                                          Public constructors                                                                                                                                                                                                           ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder#Builder(kotlin.String))`(`propertyName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Creates a new[EmbeddingPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder#). |

|                                                                                                                                                                                                                                                             Public methods                                                                                                                                                                                                                                                             ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AppSearchSchema.EmbeddingPropertyConfig](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig)                  | [build](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder#build())`()` Constructs a new[EmbeddingPropertyConfig](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig)from the contents of this builder.                          |
| [AppSearchSchema.EmbeddingPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder#) | [setCardinality](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder#setCardinality(kotlin.Int))`(`cardinality:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the cardinality of the property (whether it is optional, required or repeated).        |
| [AppSearchSchema.EmbeddingPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder#) | [setDescription](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder#setDescription(kotlin.String))`(`description:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Sets a natural language description of this property.                              |
| [AppSearchSchema.EmbeddingPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder#) | [setIndexingType](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder#setIndexingType(kotlin.Int))`(`indexingType:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Configures how a property should be indexed so that it can be retrieved by queries.      |
| [AppSearchSchema.EmbeddingPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder#) | [setQuantizationType](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder#setQuantizationType(kotlin.Int))`(`quantizationType:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Configures whether the vector contents of this property should be quantized. |

## Public constructors

### Builder

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 16](https://developer.android.com/sdkExtensions)  

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

Creates a new[EmbeddingPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder#).

|                                                          Parameters                                                          ||
|----------------|--------------------------------------------------------------------------------------------------------------|
| `propertyName` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`. |

## Public methods

### build

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 16](https://developer.android.com/sdkExtensions)  

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

Constructs a new[EmbeddingPropertyConfig](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig)from the contents of this builder.

|                                                                                        Return                                                                                        ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [AppSearchSchema.EmbeddingPropertyConfig](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig) | This value cannot be`null`. |

### setCardinality

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 16](https://developer.android.com/sdkExtensions)  

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

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

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

|                                                                                                                                                                                                                                                                                                                                                                       Parameters                                                                                                                                                                                                                                                                                                                                                                        ||
|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `cardinality` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is[android.app.appsearch.AppSearchSchema.PropertyConfig#CARDINALITY_REPEATED](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.PropertyConfig#CARDINALITY_REPEATED:kotlin.Int),[android.app.appsearch.AppSearchSchema.PropertyConfig#CARDINALITY_OPTIONAL](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.PropertyConfig#CARDINALITY_OPTIONAL:kotlin.Int), or[android.app.appsearch.AppSearchSchema.PropertyConfig#CARDINALITY_REQUIRED](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.PropertyConfig#CARDINALITY_REQUIRED:kotlin.Int) |

|                                                                                                Return                                                                                                 ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [AppSearchSchema.EmbeddingPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder#) | This value cannot be`null`. |

### setDescription

Added in[API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 18](https://developer.android.com/sdkExtensions)  

```
fun setDescription(description: String): AppSearchSchema.EmbeddingPropertyConfig.Builder
```

Sets a natural language description of this property.

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

|                                                         Parameters                                                          ||
|---------------|--------------------------------------------------------------------------------------------------------------|
| `description` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`. |

|                                                                                                Return                                                                                                 ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [AppSearchSchema.EmbeddingPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder#) | This value cannot be`null`. |

### setIndexingType

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 16](https://developer.android.com/sdkExtensions)  

```
fun setIndexingType(indexingType: Int): AppSearchSchema.EmbeddingPropertyConfig.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[android.app.appsearch.AppSearchSchema.EmbeddingPropertyConfig#INDEXING_TYPE_NONE](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig#INDEXING_TYPE_NONE:kotlin.Int), so that it will not be indexed and cannot be matched by queries.

|                                                                                                                                                                                                                                                                                   Parameters                                                                                                                                                                                                                                                                                    ||
|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `indexingType` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is[android.app.appsearch.AppSearchSchema.EmbeddingPropertyConfig#INDEXING_TYPE_NONE](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig#INDEXING_TYPE_NONE:kotlin.Int), or[android.app.appsearch.AppSearchSchema.EmbeddingPropertyConfig#INDEXING_TYPE_SIMILARITY](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig#INDEXING_TYPE_SIMILARITY:kotlin.Int) |

|                                                                                                Return                                                                                                 ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [AppSearchSchema.EmbeddingPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder#) | This value cannot be`null`. |

### setQuantizationType

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 17](https://developer.android.com/sdkExtensions)  

```
fun setQuantizationType(quantizationType: Int): AppSearchSchema.EmbeddingPropertyConfig.Builder
```

Configures whether the vector contents of this property should be quantized.

Quantization can reduce the size of the embedding search index, potentially leading to faster embedding search due to lower I/O bandwidth. Quantization is usually very reliable and in most cases will have a negligible impact on recall. Using quantization is strongly recommended.

If this method is not called, the default quantization type is[android.app.appsearch.AppSearchSchema.EmbeddingPropertyConfig#QUANTIZATION_TYPE_NONE](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig#QUANTIZATION_TYPE_NONE:kotlin.Int).

|                                                                                                                                                                                                                                                                                        Parameters                                                                                                                                                                                                                                                                                         ||
|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `quantizationType` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is[android.app.appsearch.AppSearchSchema.EmbeddingPropertyConfig#QUANTIZATION_TYPE_NONE](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig#QUANTIZATION_TYPE_NONE:kotlin.Int), or[android.app.appsearch.AppSearchSchema.EmbeddingPropertyConfig#QUANTIZATION_TYPE_8_BIT](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig#QUANTIZATION_TYPE_8_BIT:kotlin.Int) |

|                                                                                                Return                                                                                                 ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [AppSearchSchema.EmbeddingPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.EmbeddingPropertyConfig.Builder#) | This value cannot be`null`. |