AddFeatureByIndice
- This API cannot be used together with AddFeature and AddWithExtraVal.
- If this API is used to add features by indice, APIs that depend on labels, such as GetExtraValAttrByLabel, cannot be used. AddFeatureByIndice and GetFeatureByIndice must be used together.
API definition |
APP_ERROR AddFeatureByIndice(int64_t count, const void *features, const FeatureAttr *attributes, const int64_t *indices, const ExtraValAttr *extraVal = nullptr, const uint8_t *customAttr = nullptr); |
|---|---|
Function |
Adds features by indice. Currently, this API supports only FlatIP and Int8Flat (cosine distance). |
Input |
int64_t count: number of features to be added. const void *features: feature to be added. The Hamming distance requires data of the uint8_t type, Int8Flat requires data of the int8_t type, and FP16Flat requires data of the float type. const FeatureAttr *attributes: feature attribute to be added. const int64_t *indices: index of the feature to be added. const ExtraValAttr *extraVal: additional feature attribute to be added. const uint8_t *customAttr: custom feature attribute to be added. |
Output |
N/A |
Return value |
APP_ERROR: return status. For details, see Return Code Reference. |
Restrictions |
|