add

API definition

void add(idx_t n, const int8_t *x);

Function

Adds new feature vectors to the AscendIndexInt8 database. When this API is used to add a feature, its ID is in the range of [0, ntotal).

Input

idx_t n: number of feature vectors to be added.

const int8_t *x: feature vectors to be added.

Output

N/A

Return value

N/A

Restrictions

  • The length of x must be dims × n. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.
  • Value range of the total number of vectors: 0 < n < 1e9.

API definition

void add(idx_t n, const char *x);

Function

Adds new feature vectors to the AscendIndexInt8 database. When this API is used to add a feature, its ID is in the range of [0, ntotal).

Input

idx_t n: number of feature vectors to be added.

const char *x: feature vectors to be added.

Output

N/A

Return value

N/A

Restrictions

  • The length of x must be dims × n. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.
  • Value range of the total number of vectors: 0 < n < 1e9.
  • add interface cannot be used together with add_with_ids.
  • After add is used, the labels in the search result may be duplicate. If the service has requirements on labels, you are advised to use add_with_ids.