> ## 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 async methods. Every getter except `getIndexName()` calls the service's describe or training-status endpoint.

## getIndexName

```typescript theme={null}
async getIndexName(): Promise<string>
```

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

```typescript theme={null}
console.log(await index.getIndexName());
// Output: my-vectors
```

***

## getDimension

```typescript theme={null}
async getDimension(): Promise<number>
```

Vector dimensionality. Returns `0` if the index was created without a `dimension` and nothing has been upserted yet. Once non-zero, the value is cached and later calls don't reach the service.

```typescript theme={null}
console.log(await index.getDimension());
// Output: 384
```

***

## getMetric

```typescript theme={null}
async getMetric(): Promise<string>
```

Distance metric: `'euclidean'`, `'squared_euclidean'`, or `'cosine'`. Cached after the first call.

```typescript theme={null}
console.log(await index.getMetric());
// Output: euclidean
```

***

## getNLists

```typescript theme={null}
async getNLists(): Promise<number>
```

Number of IVF lists. `1` for an untrained index; the trained list count after [`train()`](./encrypted-index/train). Fetched from the service on every call.

```typescript theme={null}
console.log(await index.getNLists());
// Output: 1
```

***

## metadataSchema

```typescript theme={null}
async metadataSchema(): Promise<{ [field: string]: Required<MetadataFieldPolicy> }>
```

The per-field indexing policy set with `metadataSchema` or `textFields` in [`createIndex()`](./client/create-index#metadata-schema). Each entry has all three settings filled in: `filterable`, `pattern`, and `fullText`. `{}` when the index uses the default policy. Fetched on every call.

```typescript theme={null}
console.log(await index.metadataSchema());
// Output: { body: { filterable: false, pattern: false, fullText: true } }
```

***

## bm25

```typescript theme={null}
async bm25(): Promise<BM25Config | null>
```

The index's BM25 settings, or `null` when it has no full-text fields.

| Field | Type | Description |
| - | - | - |
| `k1` | `number` | Term-frequency saturation. |
| `b` | `number` | Length normalization. |
| `analyzerVersion` | `string \| null` | Text analyzer the index was built with. |

```typescript theme={null}
console.log(await index.bm25());
// Output:
// {
//   k1: 1.2,
//   b: 0.75,
//   analyzerVersion: 'en/1;sw=2de831ef7be676b6;snowball-english-utf8-3.0.1'
// }
```

***

## isTrained

```typescript theme={null}
async isTrained(): Promise<boolean>
```

`true` if the index has been trained. Fetched on every call.

```typescript theme={null}
if (!(await index.isTrained())) {
    await index.train();
}
```

***

## isTraining

```typescript theme={null}
async isTraining(): Promise<boolean>
```

`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 throws `CyborgDBAuthenticationError`.

```typescript theme={null}
while (await index.isTraining()) {
    await new Promise((resolve) => setTimeout(resolve, 5000));
}
console.log(await index.isTrained());
```


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