|
24 | 24 | "\n", |
25 | 25 | "## Setup\n", |
26 | 26 | "\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" |
28 | 28 | ] |
29 | 29 | }, |
30 | 30 | { |
|
42 | 42 | "# install packages\n", |
43 | 43 | "import sys\n", |
44 | 44 | "\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", |
46 | 46 | "\n", |
47 | 47 | "# import modules\n", |
48 | 48 | "from getpass import getpass\n", |
49 | 49 | "from elastic_enterprise_search import AppSearch\n", |
50 | | - "from elasticsearch import Elasticsearch\n", |
| 50 | + "from elasticsearch8 import Elasticsearch\n", |
51 | 51 | "import json" |
52 | 52 | ] |
53 | 53 | }, |
|
73 | 73 | "outputs": [], |
74 | 74 | "source": [ |
75 | 75 | "# 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", |
77 | 77 | "\n", |
78 | 78 | "# 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", |
80 | 80 | "\n", |
81 | 81 | "elasticsearch = Elasticsearch(\n", |
82 | 82 | " # For local development\n", |
|
106 | 106 | "metadata": {}, |
107 | 107 | "outputs": [], |
108 | 108 | "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", |
111 | 111 | "\n", |
112 | 112 | "app_search = AppSearch(APP_SEARCH_ENDPOINT, bearer_auth=APP_SEARCH_PRIVATE_KEY)\n", |
113 | 113 | "\n", |
|
335 | 335 | }, |
336 | 336 | { |
337 | 337 | "cell_type": "code", |
338 | | - "execution_count": 7, |
| 338 | + "execution_count": null, |
339 | 339 | "metadata": {}, |
340 | 340 | "outputs": [], |
341 | 341 | "source": [ |
|
369 | 369 | }, |
370 | 370 | { |
371 | 371 | "cell_type": "code", |
372 | | - "execution_count": 8, |
| 372 | + "execution_count": null, |
373 | 373 | "metadata": {}, |
374 | 374 | "outputs": [], |
375 | 375 | "source": [ |
|
425 | 425 | }, |
426 | 426 | { |
427 | 427 | "cell_type": "code", |
428 | | - "execution_count": 9, |
| 428 | + "execution_count": null, |
429 | 429 | "metadata": {}, |
430 | 430 | "outputs": [], |
431 | 431 | "source": [ |
|
515 | 515 | }, |
516 | 516 | { |
517 | 517 | "cell_type": "code", |
518 | | - "execution_count": 10, |
| 518 | + "execution_count": null, |
519 | 519 | "metadata": {}, |
520 | 520 | "outputs": [], |
521 | 521 | "source": [ |
|
545 | 545 | }, |
546 | 546 | { |
547 | 547 | "cell_type": "code", |
548 | | - "execution_count": 11, |
| 548 | + "execution_count": null, |
549 | 549 | "metadata": {}, |
550 | 550 | "outputs": [], |
551 | 551 | "source": [ |
|
675 | 675 | }, |
676 | 676 | { |
677 | 677 | "cell_type": "code", |
678 | | - "execution_count": 15, |
| 678 | + "execution_count": null, |
679 | 679 | "metadata": {}, |
680 | 680 | "outputs": [], |
681 | 681 | "source": [ |
|
741 | 741 | }, |
742 | 742 | { |
743 | 743 | "cell_type": "code", |
744 | | - "execution_count": 19, |
| 744 | + "execution_count": null, |
745 | 745 | "metadata": {}, |
746 | 746 | "outputs": [], |
747 | 747 | "source": [ |
|
770 | 770 | }, |
771 | 771 | { |
772 | 772 | "cell_type": "code", |
773 | | - "execution_count": 20, |
| 773 | + "execution_count": null, |
774 | 774 | "metadata": {}, |
775 | 775 | "outputs": [], |
776 | 776 | "source": [ |
|
989 | 989 | "provenance": [] |
990 | 990 | }, |
991 | 991 | "kernelspec": { |
992 | | - "display_name": "Python 3", |
| 992 | + "display_name": ".venv", |
993 | 993 | "language": "python", |
994 | 994 | "name": "python3" |
995 | 995 | }, |
|
1003 | 1003 | "name": "python", |
1004 | 1004 | "nbconvert_exporter": "python", |
1005 | 1005 | "pygments_lexer": "ipython3", |
1006 | | - "version": "3.11.9" |
| 1006 | + "version": "3.12.11" |
1007 | 1007 | } |
1008 | 1008 | }, |
1009 | 1009 | "nbformat": 4, |
|
0 commit comments