# Document.EmbeddingProperty

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

*** ** * ** ***


```
@Documented
@Retention(value = RetentionPolicy.CLASS)
@Target(value = [ElementType.FIELD, ElementType.METHOD])
annotation Document.EmbeddingProperty
```

<br />

*** ** * ** ***

Configures an `https://developer.android.com/reference/kotlin/androidx/appsearch/app/EmbeddingVector` field of a class as a property known to AppSearch.

## Summary

| ### Public functions |
|---|---|
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document.EmbeddingProperty#indexingType()()` Configures how a property should be indexed so that it can be retrieved by queries. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document.EmbeddingProperty#name()()` The name of this property. |
| `abstract 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/annotation/Document.EmbeddingProperty#quantizationType()()` Configures whether the embedding vectors in this property should be quantized. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document.EmbeddingProperty#required()()` Configures whether this property must be specified for the document to be valid. |

## Public functions

### indexingType

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

```
abstract fun indexingType(): Int
```

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

If not specified, defaults to `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.EmbeddingPropertyConfig#INDEXING_TYPE_NONE()` (the field will not be indexed and cannot be queried).

### name

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

```
abstract fun name(): String!
```

The name of this property. This string is used to query against this property.

If not specified, the name of the field in the code will be used instead.

### quantizationType

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

```
@ExperimentalAppSearchApi
abstract fun quantizationType(): Int
```

Configures whether the embedding vectors in this property should be quantized.

If not specified, defaults to `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.EmbeddingPropertyConfig#QUANTIZATION_TYPE_NONE()` (contents in this property will not be quantized.).

### required

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

```
abstract fun required(): Boolean
```

Configures whether this property must be specified for the document to be valid.

This attribute does not apply to properties of a repeated type (e.g. a list).

Please make sure you understand the consequences of required fields on `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSession#setSchemaAsync(androidx.appsearch.app.SetSchemaRequest)` before setting this attribute to `true`.