Python Client for Aliyun Opensearch
This package is still in beta stage, every possible change will be maded in future releases.
This Python package is automatically generated by the Swagger Codegen project:
- API version: 3.0.1
- Package version: 0.0.1
- Build package: io.swagger.codegen.languages.PythonClientCodegen
Python 2.7 and 3.4+
You can install directly from Github
pip install git+https://github.com/Timandes/opensearch-python.git
(you may need to run pip
with root permission: sudo pip install git+https://github.com/Timandes/opensearch-python.git
)
Then import the package:
import opensearch
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import opensearch
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import opensearch
from opensearch.rest import ApiException
from pprint import pprint
# Configure opensearch authorization: opensearch
configuration = opensearch.Configuration()
configuration.host = "OPENSEARCH_ENDPOINT"
configuration.access_key = 'YOUR_ACCESS_KEY'
configuration.access_key_secret = 'YOUR_ACCESS_KEY_SECRET'
# create an instance of the API class
api_instance = opensearch.SearchClient(opensearch.ApiClient(configuration))
app_name = 'app_name_example' # str | 表示应用名(新高级版/标准版是多应用版本类型,需要指定应用名访问,主要针对服务中的应用版本)。
query = 'query=default:\'天猫\'' # str | 搜索主体,不能为空。主要支持子句有 config子句、query子句、sort子句、filter子句、aggregate子句、distinct子句 、kvpairs子句。
try:
# 搜搜处理
api_response = api_instance.v3_openapi_apps_app_name_search_get(app_name, query)
pprint(api_response)
except ApiException as e:
print("Exception when calling SearchClient->v3_openapi_apps_app_name_search_get: %s\n" % e)
All URIs are relative to a fixed prefix.
Class | Method | HTTP request | Description |
---|---|---|---|
DefaultApi | v3_openapi_app_groups_app_name_data_collections_collector_name_actions_bulk_post | POST /v3/openapi/app-groups/{app_name}/data-collections/{collector_name}/actions/bulk | 数据采集 |
DefaultApi | v3_openapi_apps_app_name_search_get | GET /v3/openapi/apps/{app_name}/search | 搜索处理 |
DefaultApi | v3_openapi_apps_app_name_suggest_model_name_search_get | GET /v3/openapi/apps/{app_name}/suggest/{model_name}/search | 下拉提示 |
DefaultApi | v3_openapi_apps_app_name_table_name_actions_bulk_post | POST /v3/openapi/apps/{app_name}/{table_name}/actions/bulk | 数据处理 |
- Behavior
- BehaviorFields
- Document
- Error
- Errors
- Event2001Args
- RequestId
- Response
- SearchResponse
- SearchResult
- SearchResultFacet
- SearchResultFacetItems
- SearchResultItem
- SearchResultItemFullJson
- Status
- SuggestionResponse
- SuggestionResponseSuggestions
Timandes White [email protected]