LoadIndex

API definition

APP_ERROR LoadIndex(const std::string& indexPath, AscendIndexVStar* indexVStar = nullptr);

Function

Reads the existing index from a drive to the device.

Input

const std::string& indexPath: data file path.

AscendIndexVStar* indexVStar: used only when MultiSearch is called. If this parameter is used, all indexes share the codebook of the first index.

Output

N/A

Return value

APP_ERROR: return status. For details, see Return Code Reference.

Restrictions

  • Ensure that the directory where indexPath is located exists and the running user has the read permission on the directory. For security hardening, the directory level cannot contain soft links.
  • If MultiSearch is called, indexVStar cannot be a null pointer. In the single-index scenario, indexVStar must be a null pointer. In this case, if a valid index pointer is used, the original index codebook will be replaced by the index instance codebook.