Skip to content

Hybrid

OpenSearch implementation of hybrid search capability.

This module provides hybrid search combining fulltext (BM25) and vector (dense) retrieval for OpenSearch while reusing the common Elasticsearch-like hybrid logic.

OpenSearchHybridCapability(index_name, client, config, encryption=None, default_batch_size=None)

Bases: ElasticsearchHybridCapability

OpenSearch hybrid capability backed by BM25 and k-NN search.

Initialize the OpenSearch hybrid capability.

Parameters:

Name Type Description Default
index_name str

The name of the OpenSearch index.

required
client AsyncOpenSearch

The OpenSearch client.

required
config list[SearchConfig]

List of search configurations.

required
encryption EncryptionCapability | None

Encryption capability. Defaults to None.

None
default_batch_size int | None

Default batch size. Defaults to None.

None

Raises:

Type Description
ValueError

If no hybrid search configuration is provided.