add_with_ids

API definition

void add_with_ids(idx_t n, const int8_t *x, const idx_t *ids);

Function

Adds new feature vectors to the AscendIndexInt8 database and specifies their IDs.

Input

idx_t n: number of feature vectors to be added.

const int8_t *x: feature vectors to be added.

const idx_t *ids: IDs of the feature vectors to be added. The ID must be unique in the Index instance.

Output

N/A

Return value

N/A

Restrictions

  • The length of x must be dims × n, and the length of ids must be 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_with_ids(idx_t n, const char *x, const idx_t *ids);

Function

Adds new feature vectors to the AscendIndexInt8 database and specifies their IDs.

Input

idx_t n: number of feature vectors to be added.

const char *x: feature vectors to be added.

const idx_t *ids: IDs of the feature vectors to be added. The ID must be unique in the Index instance.

Output

N/A

Return value

N/A

Restrictions

  • The length of x must be dims × n, and the length of ids must be 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.