Skip to main content
v0.17 removes the GetIndexType and GetIndexConfig methods — there is now a single DiskIVF index type. The Go SDK exposes GetIndexName, IsTrained, IsTraining, and the three describe-backed accessors Dimension, Metric, and NLists.

GetIndexName

Returns the unique name of the index. Known at construction — no API call.
Returns: string - The index name as specified during creation Example:

Dimension

Returns the vector dimensionality of the index.
  • Returns the real dimension when CreateIndex was called with an explicit Dimension, or after the first upsert (auto-detect).
  • Returns 0 when the index was created with auto-detect AND no upsert has happened yet.
Each call queries the describe endpoint for live state.
Parameters:
  • ctx: context.Context — context for cancellation and timeouts
Returns:
  • int32 — vector dimension
  • error — any error encountered during the lookup
Example:

Metric

Returns the distance metric used by this index: "euclidean", "squared_euclidean", or "cosine".
Parameters:
  • ctx: context.Context — context for cancellation and timeouts
Returns:
  • string — the distance metric
  • error — any error encountered during the lookup
Example:

NLists

Returns the number of inverted lists in the IVF index.
  • Returns 1 for untrained indexes.
  • Returns the trained cluster count after Train completes.
Each call queries the describe endpoint so post-training callers see the updated value.
Parameters:
  • ctx: context.Context — context for cancellation and timeouts
Returns:
  • int32 — number of inverted lists
  • error — any error encountered during the lookup
Example:

IsTrained

Checks whether the index has been optimized through training. Makes an API call to get the current training status from the server.
Parameters:
  • ctx: context.Context — context for cancellation and timeouts
Returns:
  • booltrue if the index has been trained, false otherwise
  • error — any error encountered during the status check
Example:

IsTraining

Queries the server to check if the index is currently being trained (either actively training or queued).
Parameters:
  • ctx: context.Context — context for cancellation and timeouts
Returns:
  • booltrue if the index is currently being trained or queued, false otherwise
  • error — any error encountered during the status check
Example: