Skip to content

hopsworks.core.opensearch_api #

[source] OpenSearchApi #

For backwards compatibility hopsworks.core.opensearch_api.OpenSearchApi is still available as hsfs.core.opensearch_api.OpenSearchApi. The use of this alias is discouraged as it is to be deprecated.

[source] get_project_index #

get_project_index(index: str) -> str

This helper method prefixes the supplied index name with the project name to avoid index name clashes.

PARAMETER DESCRIPTION
index

The opensearch index to interact with.

TYPE: str

RETURNS DESCRIPTION
str

A valid opensearch index name.

[source] get_default_py_config #

get_default_py_config(
    feature_store_id: int = None,
) -> dict[str, Any]

Get the required opensearch configuration to setup a connection using the opensearch-py library.

import hopsworks
from opensearchpy import OpenSearch

project = hopsworks.login()

opensearch_api = project.get_opensearch_api()

client = OpenSearch(**opensearch_api.get_default_py_config())
RETURNS DESCRIPTION
dict[str, Any]

A dictionary with required configuration.