loadIndex method

AnnoyIndex? loadIndex(
  1. String path,
  2. int dimension,
  3. IndexType type
)

Load a pre-built annoy index, returns null if failed.

Implementation

AnnoyIndex? loadIndex(String path, int dimension, IndexType type) {
  var indexPtr = _loadAnnoyIndex(path.toNativeUtf8(), dimension, type.index);
  if (indexPtr.address == 0) {
    return null;
  }
  return AnnoyIndex._create(this, indexPtr, type);
}