# ApproxRetrievalStrategy

> **Class** in `langchain_elasticsearch`

📖 [View in docs](https://reference.langchain.com/python/langchain-elasticsearch/_utilities/ApproxRetrievalStrategy)

Approximate retrieval strategy using the `HNSW` algorithm.

## Signature

```python
ApproxRetrievalStrategy(
    self,
    query_model_id: Optional[str] = None,
    hybrid: Optional[bool] = False,
    rrf: Optional[Union[dict, bool]] = True,
)
```

## Extends

- `BaseRetrievalStrategy`

## Constructors

```python
__init__(
    self,
    query_model_id: Optional[str] = None,
    hybrid: Optional[bool] = False,
    rrf: Optional[Union[dict, bool]] = True,
)
```

| Name | Type |
|------|------|
| `query_model_id` | `Optional[str]` |
| `hybrid` | `Optional[bool]` |
| `rrf` | `Optional[Union[dict, bool]]` |


## Properties

- `query_model_id`
- `hybrid`
- `rrf`

## Methods

- [`query()`](https://reference.langchain.com/python/langchain-elasticsearch/_utilities/ApproxRetrievalStrategy/query)
- [`before_index_setup()`](https://reference.langchain.com/python/langchain-elasticsearch/_utilities/ApproxRetrievalStrategy/before_index_setup)
- [`index()`](https://reference.langchain.com/python/langchain-elasticsearch/_utilities/ApproxRetrievalStrategy/index)

## ⚠️ Deprecated

Deprecated since version 0.2.0. Use DenseVectorStrategy instead.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-elastic/blob/e78a327f38e09abd10128ed28c8774e9a8f9fec0/libs/elasticsearch/langchain_elasticsearch/_utilities.py#L188)