OpenSearch API#
Handle#
get_opensearch_api#
Project.get_opensearch_api()
Get the opensearch api for the project.
Returns
OpenSearchApi
: The OpenSearch Api handle
Methods#
get_default_py_config#
OpenSearchApi.get_default_py_config()
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
dict
: A dictionary with required configuration.
get_project_index#
OpenSearchApi.get_project_index(index)
This helper method prefixes the supplied index name with the project name to avoid index name clashes.
Arguments
- index
str
: the opensearch index to interact with.
Returns
str
: A valid opensearch index name.