# AppSearchSchema.EmbeddingPropertyConfig

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.EmbeddingPropertyConfig) 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_EMBEDDING_PROPERTY_CONFIG)
class AppSearchSchema.EmbeddingPropertyConfig : AppSearchSchema.PropertyConfig
```

<br />

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

*** ** * ** ***

Configuration for a property of type `https://developer.android.com/reference/kotlin/androidx/appsearch/app/EmbeddingVector` in a Document.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.EmbeddingPropertyConfig.Builder` Builder for `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.EmbeddingPropertyConfig`. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@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_EMBEDDING_APPROXIMATE_NEAREST_NEIGHBOR) @https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.EmbeddingPropertyConfig#INDEXING_TYPE_APPROXIMATE_NEAREST_NEIGHBOR() = 2` Embedding vectors in this property will be indexed for Approximate Nearest Neighbor (ANN) search. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.EmbeddingPropertyConfig#INDEXING_TYPE_NONE() = 0` Content in this property will not be indexed. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.EmbeddingPropertyConfig#INDEXING_TYPE_SIMILARITY() = 1` Embedding vectors in this property will be indexed. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.EmbeddingPropertyConfig#QUANTIZATION_TYPE_8_BIT() = 1` Contents in this property will be quantized to 8 bits. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.EmbeddingPropertyConfig#QUANTIZATION_TYPE_NONE() = 0` Contents in this property will not be quantized. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.EmbeddingPropertyConfig#getIndexingType()()` Returns how the property is indexed. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.EmbeddingPropertyConfig#getQuantizationType()()` Returns how the embedding contents of this property should be quantized. |

### Inherited Constants

From [androidx.appsearch.app.AppSearchSchema.PropertyConfig](https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig) `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#CARDINALITY_OPTIONAL() = 2`

Zero or one value \[0,1\].
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#CARDINALITY_REPEATED() = 1`

Any number of items (including zero) \[0...\*\].
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#CARDINALITY_REQUIRED() = 3`

Exactly one value \[1\].

### Inherited functions

From [androidx.appsearch.app.AppSearchSchema.PropertyConfig](https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#equals(java.lang.Object)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#getCardinality()()`

Returns the cardinality of the property (whether it is optional, required or repeated).
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#getDescription()()`

Returns a natural language description of this property.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#getName()()`

Returns the name of this property.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#hashCode()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#toString()()`

## Constants

### INDEXING_TYPE_APPROXIMATE_NEAREST_NEIGHBOR

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

```
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.SCHEMA_EMBEDDING_APPROXIMATE_NEAREST_NEIGHBOR)
@ExperimentalAppSearchApi
const val INDEXING_TYPE_APPROXIMATE_NEAREST_NEIGHBOR = 2: Int
```

Embedding vectors in this property will be indexed for Approximate Nearest Neighbor (ANN) search.

The index maintains clusters of embedding vectors to offer faster search latency than a full linear scan, but does not guarantee 100% recall. This allows tuning the trade-off between search latency and recall at search time by configuring the number of clusters to search via `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSpec.Builder#setEmbeddingQueryProbeCount(int)`.

### INDEXING_TYPE_NONE

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

```
const val INDEXING_TYPE_NONE = 0: Int
```

Content in this property will not be indexed.

### INDEXING_TYPE_SIMILARITY

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

```
const val INDEXING_TYPE_SIMILARITY = 1: Int
```

Embedding vectors in this property will be indexed.

The index offers 100% accuracy, but has linear time complexity based on the number of embedding vectors within the index.

### QUANTIZATION_TYPE_8_BIT

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

```
@ExperimentalAppSearchApi
const val QUANTIZATION_TYPE_8_BIT = 1: Int
```

Contents in this property will be quantized to 8 bits.

### QUANTIZATION_TYPE_NONE

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

```
@ExperimentalAppSearchApi
const val QUANTIZATION_TYPE_NONE = 0: Int
```

Contents in this property will not be quantized.

## Public functions

### getIndexingType

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

```
fun getIndexingType(): Int
```

Returns how the property is indexed.

### getQuantizationType

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

```
@ExperimentalAppSearchApi
fun getQuantizationType(): Int
```

Returns how the embedding contents of this property should be quantized.

If the property isn't indexed, returns `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.EmbeddingPropertyConfig#QUANTIZATION_TYPE_NONE()`.