# HybridSearchConfig

> **Class** in `langchain_postgres`

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

AlloyDB Vector Store Hybrid Search Config.

Queries might be slow if the hybrid search column does not exist.
For best hybrid search performance, consider creating a TSV column
and adding GIN index.

## Signature

```python
HybridSearchConfig(
    self,
    tsv_column: Optional[str] = '',
    tsv_lang: Optional[str] = 'pg_catalog.english',
    fts_query: Optional[str] = '',
    fusion_function: Callable[[Sequence[RowMapping], Sequence[RowMapping], Any], Sequence[Any]] = weighted_sum_ranking,
    fusion_function_parameters: dict[str, Any] = dict(),
    primary_top_k: int = 4,
    secondary_top_k: int = 4,
    index_name: str = 'langchain_tsv_index',
    index_type: str = 'GIN',
)
```

## Extends

- `ABC`

## Constructors

```python
__init__(
    self,
    tsv_column: Optional[str] = '',
    tsv_lang: Optional[str] = 'pg_catalog.english',
    fts_query: Optional[str] = '',
    fusion_function: Callable[[Sequence[RowMapping], Sequence[RowMapping], Any], Sequence[Any]] = weighted_sum_ranking,
    fusion_function_parameters: dict[str, Any] = dict(),
    primary_top_k: int = 4,
    secondary_top_k: int = 4,
    index_name: str = 'langchain_tsv_index',
    index_type: str = 'GIN',
) -> None
```

| Name | Type |
|------|------|
| `tsv_column` | `Optional[str]` |
| `tsv_lang` | `Optional[str]` |
| `fts_query` | `Optional[str]` |
| `fusion_function` | `Callable[[Sequence[RowMapping], Sequence[RowMapping], Any], Sequence[Any]]` |
| `fusion_function_parameters` | `dict[str, Any]` |
| `primary_top_k` | `int` |
| `secondary_top_k` | `int` |
| `index_name` | `str` |
| `index_type` | `str` |


## Properties

- `tsv_column`
- `tsv_lang`
- `fts_query`
- `fusion_function`
- `fusion_function_parameters`
- `primary_top_k`
- `secondary_top_k`
- `index_name`
- `index_type`

---

[View source on GitHub](https://github.com/langchain-ai/langchain-postgres/blob/3b573858a0cf525b262fa974b224dddff79ba985/langchain_postgres/v2/hybrid_search_config.py#L192)