Skip to content

Commit c009c1f

Browse files
committed
update elasticsearch8 import
1 parent f14e078 commit c009c1f

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

notebooks/enterprise-search/app-search-engine-exporter.ipynb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"\n",
2525
"## Setup\n",
2626
"\n",
27-
"Let's start by making sure our Elasticsearch and Enterprise Search clients are installed. We'll also use `getpass` to ensure we can allow secure user inputs for our IDs and keys to access our Elasticsearch instance.\n"
27+
"Let's start by making sure our Elasticsearch and Enterprise Search clients are installed. We'll also use `getpass` to ensure we can allow secure user inputs for our IDs and keys to access our Elasticsearch instance. Note that we use the `elasticsearch8` package, as Enterprise Search is not available in Elasticsearch 9 and higher.\n"
2828
]
2929
},
3030
{
@@ -42,12 +42,12 @@
4242
"# install packages\n",
4343
"import sys\n",
4444
"\n",
45-
"!{sys.executable} -m pip install -qU elasticsearch elastic-enterprise-search\n",
45+
"!{sys.executable} -m pip install -qU elasticsearch8 elastic-enterprise-search\n",
4646
"\n",
4747
"# import modules\n",
4848
"from getpass import getpass\n",
4949
"from elastic_enterprise_search import AppSearch\n",
50-
"from elasticsearch import Elasticsearch\n",
50+
"from elasticsearch8 import Elasticsearch\n",
5151
"import json"
5252
]
5353
},
@@ -73,10 +73,10 @@
7373
"outputs": [],
7474
"source": [
7575
"# https://www.elastic.co/search-labs/tutorials/install-elasticsearch/elastic-cloud#finding-your-cloud-id\n",
76-
"ELASTIC_CLOUD_ID = getpass(\"Elastic Cloud ID: \")\n",
76+
"ELASTIC_CLOUD_ID = \"mjh-app-search-exporter-test:dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlvOjQ0MyRlNzE4ZTY5ZTgyYzg0MzlkODMwMTRjMWJlYWIxZWZkMiRlZGUwMTE1MDM1ZjQ0ZjMxYTc5ZDU5MTRhZDQ1MWY1MA==\"\n",
7777
"\n",
7878
"# https://www.elastic.co/search-labs/tutorials/install-elasticsearch/elastic-cloud#creating-an-api-key\n",
79-
"ELASTIC_API_KEY = getpass(\"Elastic Api Key: \")\n",
79+
"ELASTIC_API_KEY = \"Z2dpajVKa0I2UW56Zk9xYUtNT086cWNKbmw0ZEFjTnFJbTJIU295MVZHQQ==\"\n",
8080
"\n",
8181
"elasticsearch = Elasticsearch(\n",
8282
" # For local development\n",
@@ -106,8 +106,8 @@
106106
"metadata": {},
107107
"outputs": [],
108108
"source": [
109-
"APP_SEARCH_ENDPOINT = getpass(\"App Search endpoint: \")\n",
110-
"APP_SEARCH_PRIVATE_KEY = getpass(\"App Search private key: \")\n",
109+
"APP_SEARCH_ENDPOINT = \"https://mjh-app-search-exporter-test-b64877.ent.us-central1.gcp.cloud.es.io\"\n",
110+
"APP_SEARCH_PRIVATE_KEY = \"private-iubp52vt6sbc7g8vziwzhor2\"\n",
111111
"\n",
112112
"app_search = AppSearch(APP_SEARCH_ENDPOINT, bearer_auth=APP_SEARCH_PRIVATE_KEY)\n",
113113
"\n",
@@ -335,7 +335,7 @@
335335
},
336336
{
337337
"cell_type": "code",
338-
"execution_count": 7,
338+
"execution_count": null,
339339
"metadata": {},
340340
"outputs": [],
341341
"source": [
@@ -369,7 +369,7 @@
369369
},
370370
{
371371
"cell_type": "code",
372-
"execution_count": 8,
372+
"execution_count": null,
373373
"metadata": {},
374374
"outputs": [],
375375
"source": [
@@ -425,7 +425,7 @@
425425
},
426426
{
427427
"cell_type": "code",
428-
"execution_count": 9,
428+
"execution_count": null,
429429
"metadata": {},
430430
"outputs": [],
431431
"source": [
@@ -515,7 +515,7 @@
515515
},
516516
{
517517
"cell_type": "code",
518-
"execution_count": 10,
518+
"execution_count": null,
519519
"metadata": {},
520520
"outputs": [],
521521
"source": [
@@ -545,7 +545,7 @@
545545
},
546546
{
547547
"cell_type": "code",
548-
"execution_count": 11,
548+
"execution_count": null,
549549
"metadata": {},
550550
"outputs": [],
551551
"source": [
@@ -675,7 +675,7 @@
675675
},
676676
{
677677
"cell_type": "code",
678-
"execution_count": 15,
678+
"execution_count": null,
679679
"metadata": {},
680680
"outputs": [],
681681
"source": [
@@ -741,7 +741,7 @@
741741
},
742742
{
743743
"cell_type": "code",
744-
"execution_count": 19,
744+
"execution_count": null,
745745
"metadata": {},
746746
"outputs": [],
747747
"source": [
@@ -770,7 +770,7 @@
770770
},
771771
{
772772
"cell_type": "code",
773-
"execution_count": 20,
773+
"execution_count": null,
774774
"metadata": {},
775775
"outputs": [],
776776
"source": [
@@ -989,7 +989,7 @@
989989
"provenance": []
990990
},
991991
"kernelspec": {
992-
"display_name": "Python 3",
992+
"display_name": ".venv",
993993
"language": "python",
994994
"name": "python3"
995995
},
@@ -1003,7 +1003,7 @@
10031003
"name": "python",
10041004
"nbconvert_exporter": "python",
10051005
"pygments_lexer": "ipython3",
1006-
"version": "3.11.9"
1006+
"version": "3.12.11"
10071007
}
10081008
},
10091009
"nbformat": 4,

0 commit comments

Comments
 (0)