# BaseIndex

> **Class** in `langchain_postgres`

📖 [View in docs](https://reference.langchain.com/python/langchain-postgres/v2/indexes/BaseIndex)

Abstract base class for defining vector indexes.

## Signature

```python
BaseIndex(
    self,
    name: Optional[str] = None,
    index_type: str = 'base',
    distance_strategy: DistanceStrategy = (lambda: DistanceStrategy.COSINE_DISTANCE)(),
    partial_indexes: Optional[list[str]] = None,
    extension_name: Optional[str] = None,
)
```

## Extends

- `ABC`

## Constructors

```python
__init__(
    self,
    name: Optional[str] = None,
    index_type: str = 'base',
    distance_strategy: DistanceStrategy = (lambda: DistanceStrategy.COSINE_DISTANCE)(),
    partial_indexes: Optional[list[str]] = None,
    extension_name: Optional[str] = None,
) -> None
```

| Name | Type |
|------|------|
| `name` | `Optional[str]` |
| `index_type` | `str` |
| `distance_strategy` | `DistanceStrategy` |
| `partial_indexes` | `Optional[list[str]]` |
| `extension_name` | `Optional[str]` |


## Properties

- `name`
- `index_type`
- `distance_strategy`
- `partial_indexes`
- `extension_name`

## Methods

- [`index_options()`](https://reference.langchain.com/python/langchain-postgres/v2/indexes/BaseIndex/index_options)
- [`get_index_function()`](https://reference.langchain.com/python/langchain-postgres/v2/indexes/BaseIndex/get_index_function)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-postgres/blob/9d819182da7e3fb1b815e6c9a6b7c2cd1eb4bc0e/langchain_postgres/v2/indexes.py#L40)