Skip to content

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
Huaixinww committed Sep 18, 2024
1 parent 4b9ca99 commit 1b1ac85
Showing 1 changed file with 7 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"\n",
"For this example, you will need:\n",
"\n",
"- An Elastic deployment with minimum **4GB machine learning node**\n",
"- An Elastic deployment:\n",
" - we'll be using [Alibaba Elasticsearch](https://www.aliyun.com/product/bigdata/elasticsearch) for this example.\n",
"- Elasticsearch 8.16 or above\n",
"- A valid API key for the [AlibabaCloud AI Search](https://help.aliyun.com/zh/open-search/search-platform/user-guide/activate-services-and-create-api-key?spm=a2c4g.11186623.0.0.141a2105fiqCEw) is required to use the Inference API with\n",
Expand Down Expand Up @@ -56,7 +56,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -87,16 +87,15 @@
"\n",
"ELASTIC_PASSWORD = getpass(\"ELASTIC PASSWORD: \")\n",
"\n",
"# Please enter your ES cluster URL here\n",
"# e.g. \n",
"# ELASTIC_URL = \"http://es-xxx.elasticsearch.aliyuncs.com:9200\"\n",
"ELASTIC_URL = \"\"\n",
"# hosts = \"http://es-xxx.elasticsearch.aliyuncs.com:9200\"\n",
"hosts=getpass(\"Host: \")\n",
"\n",
"# Create the client instance\n",
"client = Elasticsearch(\n",
" # For local development\n",
" # hosts=[\"http://localhost:9200\"]\n",
" ELASTIC_URL,\n",
" hosts,\n",
" basic_auth=(ELASTIC_USER, ELASTIC_PASSWORD)\n",
")"
]
Expand All @@ -110,17 +109,9 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'name': 'es-cn-kvw3sriro00013ijf-data-g-2', 'cluster_name': 'es-cn-kvw3sriro00013ijf', 'cluster_uuid': 'Zh1hPR59Qf2wQpMCnzuoyQ', 'version': {'number': '8.15.0', 'build_flavor': 'default', 'build_type': 'docker', 'build_hash': '27668b65831e9e4eff409e9a3021d601e22b3f74', 'build_date': '2024-07-24T07:11:07.450209633Z', 'build_snapshot': False, 'lucene_version': '9.11.1', 'minimum_wire_compatibility_version': '7.17.0', 'minimum_index_compatibility_version': '7.0.0'}, 'tagline': 'You Know, for Search'}\n"
]
}
],
"outputs": [],
"source": [
"print(client.info())"
]
Expand Down

0 comments on commit 1b1ac85

Please sign in to comment.