OpenSearch API#
You can obtain an OpenSearchApi handle via Project.get_opensearch_api.
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 | DESCRIPTION |
|---|---|
dict[str, Any] | A dictionary with required configuration. |
OpensearchRequestOption #
get_options classmethod #
get_options(options: dict)
Construct a map of options for the request to the vector database.
| PARAMETER | DESCRIPTION |
|---|---|
options | The options used for the request to the vector database. The keys are attribute values of the OpensearchRequestOption class. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
dict | A dictionary containing the constructed options map, where keys represent |
| attribute values of the OpensearchRequestOption class, and values are obtained | |
| either from the provided options or default values if not available. |