> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cyborg.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Getters

`*EncryptedIndex` exposes index settings and training status as methods. Every getter except `GetIndexName` takes a `context.Context` and calls the service's describe or training-status endpoint. Nothing is cached, so each call returns the current value.

## GetIndexName

```go theme={null}
func (e *EncryptedIndex) GetIndexName() string
```

The index's name. Read locally, with no network call.

```go theme={null}
fmt.Println(index.GetIndexName())
// Output: my-vectors
```

***

## Dimension

```go theme={null}
func (e *EncryptedIndex) Dimension(ctx context.Context) (int32, error)
```

Vector dimensionality. Returns `0` if the index was created without a `Dimension` and nothing has been upserted yet.

```go theme={null}
dim, err := index.Dimension(ctx)
if err != nil {
    log.Fatal(err)
}
fmt.Println(dim)
// Output: 384
```

***

## Metric

```go theme={null}
func (e *EncryptedIndex) Metric(ctx context.Context) (string, error)
```

Distance metric: `"euclidean"`, `"squared_euclidean"`, or `"cosine"`.

```go theme={null}
metric, err := index.Metric(ctx)
if err != nil {
    log.Fatal(err)
}
fmt.Println(metric)
// Output: euclidean
```

***

## NLists

```go theme={null}
func (e *EncryptedIndex) NLists(ctx context.Context) (int32, error)
```

Number of IVF lists. `1` for an untrained index; the trained list count after [`Train`](./encrypted-index/train).

```go theme={null}
nLists, err := index.NLists(ctx)
if err != nil {
    log.Fatal(err)
}
fmt.Println(nLists)
// Output: 1
```

***

## MetadataSchema

```go theme={null}
func (e *EncryptedIndex) MetadataSchema(ctx context.Context) (map[string]MetadataFieldPolicy, error)
```

The per-field indexing policy set with `MetadataSchema` or `TextFields` in [`CreateIndex`](./client/create-index#metadata-schema). Never `nil`: an empty map when the index uses the default policy. The `MetadataFieldPolicy` fields are `*bool`; read them with `GetFilterable()`, `GetPattern()`, and `GetFullText()`.

```go theme={null}
schema, err := index.MetadataSchema(ctx)
if err != nil {
    log.Fatal(err)
}
for field, p := range schema {
    fmt.Println(field, p.GetFilterable(), p.GetPattern(), p.GetFullText())
}
// Output: body false false true
```

***

## BM25

```go theme={null}
func (e *EncryptedIndex) BM25(ctx context.Context) (*BM25Config, error)
```

The index's BM25 settings, or `nil` (with a `nil` error) when it has no full-text fields.

| Field / method | Type | Description |
| - | - | - |
| `K1` | `float32` | Term-frequency saturation. |
| `B` | `float32` | Length normalization. |
| `GetAnalyzerVersion()` | `string` | Text analyzer the index was built with. |

```go theme={null}
bm25, err := index.BM25(ctx)
if err != nil {
    log.Fatal(err)
}
fmt.Println(bm25.K1, bm25.B, bm25.GetAnalyzerVersion())
// Output: 1.2 0.75 en/1;sw=2de831ef7be676b6;snowball-english-utf8-3.0.1
```

***

## IsTrained

```go theme={null}
func (e *EncryptedIndex) IsTrained(ctx context.Context) (bool, error)
```

`true` if the index has been trained.

```go theme={null}
trained, err := index.IsTrained(ctx)
if err != nil {
    log.Fatal(err)
}
if !trained {
    if err := index.Train(ctx, cyborgdb.TrainParams{}); err != nil {
        log.Fatal(err)
    }
}
```

***

## IsTraining

```go theme={null}
func (e *EncryptedIndex) IsTraining(ctx context.Context) (bool, error)
```

`true` while the service is training this index or has it queued for training. Requires the root key: with a per-user key the service returns HTTP `403` and the SDK returns `*AuthenticationError`.

```go theme={null}
for {
    training, err := index.IsTraining(ctx)
    if err != nil {
        log.Fatal(err)
    }
    if !training {
        break
    }
    time.Sleep(5 * time.Second)
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.