AppSearchSchema.EmbeddingPropertyConfig.Builder
public
static
final
class
AppSearchSchema.EmbeddingPropertyConfig.Builder
extends Object
java.lang.Object | |
↳ | android.app.appsearch.AppSearchSchema.EmbeddingPropertyConfig.Builder |
Builder for EmbeddingPropertyConfig
.
Summary
Public constructors | |
---|---|
Builder(String propertyName)
Creates a new |
Public methods | |
---|---|
AppSearchSchema.EmbeddingPropertyConfig
|
build()
Constructs a new |
AppSearchSchema.EmbeddingPropertyConfig.Builder
|
setCardinality(int cardinality)
Sets the cardinality of the property (whether it is optional, required or repeated). |
AppSearchSchema.EmbeddingPropertyConfig.Builder
|
setIndexingType(int indexingType)
Configures how a property should be indexed so that it can be retrieved by queries. |
AppSearchSchema.EmbeddingPropertyConfig.Builder
|
setQuantizationType(int quantizationType)
Configures whether the vector contents of this property should be quantized. |
Inherited methods | |
---|---|
Public constructors
Builder
public Builder (String propertyName)
Creates a new EmbeddingPropertyConfig.Builder
.
Parameters | |
---|---|
propertyName |
String : This value cannot be null . |
Public methods
build
public AppSearchSchema.EmbeddingPropertyConfig build ()
Constructs a new EmbeddingPropertyConfig
from the contents of this builder.
Returns | |
---|---|
AppSearchSchema.EmbeddingPropertyConfig |
This value cannot be null . |
setCardinality
public AppSearchSchema.EmbeddingPropertyConfig.Builder setCardinality (int cardinality)
Sets the cardinality of the property (whether it is optional, required or repeated).
If this method is not called, the default cardinality is AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL
.
Parameters | |
---|---|
cardinality |
int : Value is AppSearchSchema.PropertyConfig.CARDINALITY_REPEATED , AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL , or AppSearchSchema.PropertyConfig.CARDINALITY_REQUIRED |
Returns | |
---|---|
AppSearchSchema.EmbeddingPropertyConfig.Builder |
This value cannot be null . |
setIndexingType
public AppSearchSchema.EmbeddingPropertyConfig.Builder setIndexingType (int indexingType)
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 AppSearchSchema.EmbeddingPropertyConfig.INDEXING_TYPE_NONE
, so that it will not be indexed and
cannot be matched by queries.
Parameters | |
---|---|
indexingType |
int : Value is AppSearchSchema.EmbeddingPropertyConfig.INDEXING_TYPE_NONE , or AppSearchSchema.EmbeddingPropertyConfig.INDEXING_TYPE_SIMILARITY |
Returns | |
---|---|
AppSearchSchema.EmbeddingPropertyConfig.Builder |
This value cannot be null . |
setQuantizationType
public AppSearchSchema.EmbeddingPropertyConfig.Builder setQuantizationType (int quantizationType)
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 AppSearchSchema.EmbeddingPropertyConfig.QUANTIZATION_TYPE_NONE
.
Parameters | |
---|---|
quantizationType |
int : Value is AppSearchSchema.EmbeddingPropertyConfig.QUANTIZATION_TYPE_NONE , or AppSearchSchema.EmbeddingPropertyConfig.QUANTIZATION_TYPE_8_BIT |
Returns | |
---|---|
AppSearchSchema.EmbeddingPropertyConfig.Builder |
This value cannot be null . |