From c009c1f858c21ce2cdb01fbf56c7bcf5d29c8b0c Mon Sep 17 00:00:00 2001 From: "Mark J. Hoy" Date: Fri, 17 Oct 2025 23:13:56 -0400 Subject: [PATCH 1/4] update elasticsearch8 import --- .../app-search-engine-exporter.ipynb | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/notebooks/enterprise-search/app-search-engine-exporter.ipynb b/notebooks/enterprise-search/app-search-engine-exporter.ipynb index 5821babd..109b5239 100644 --- a/notebooks/enterprise-search/app-search-engine-exporter.ipynb +++ b/notebooks/enterprise-search/app-search-engine-exporter.ipynb @@ -24,7 +24,7 @@ "\n", "## Setup\n", "\n", - "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" + "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" ] }, { @@ -42,12 +42,12 @@ "# install packages\n", "import sys\n", "\n", - "!{sys.executable} -m pip install -qU elasticsearch elastic-enterprise-search\n", + "!{sys.executable} -m pip install -qU elasticsearch8 elastic-enterprise-search\n", "\n", "# import modules\n", "from getpass import getpass\n", "from elastic_enterprise_search import AppSearch\n", - "from elasticsearch import Elasticsearch\n", + "from elasticsearch8 import Elasticsearch\n", "import json" ] }, @@ -73,10 +73,10 @@ "outputs": [], "source": [ "# https://www.elastic.co/search-labs/tutorials/install-elasticsearch/elastic-cloud#finding-your-cloud-id\n", - "ELASTIC_CLOUD_ID = getpass(\"Elastic Cloud ID: \")\n", + "ELASTIC_CLOUD_ID = \"mjh-app-search-exporter-test:dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlvOjQ0MyRlNzE4ZTY5ZTgyYzg0MzlkODMwMTRjMWJlYWIxZWZkMiRlZGUwMTE1MDM1ZjQ0ZjMxYTc5ZDU5MTRhZDQ1MWY1MA==\"\n", "\n", "# https://www.elastic.co/search-labs/tutorials/install-elasticsearch/elastic-cloud#creating-an-api-key\n", - "ELASTIC_API_KEY = getpass(\"Elastic Api Key: \")\n", + "ELASTIC_API_KEY = \"Z2dpajVKa0I2UW56Zk9xYUtNT086cWNKbmw0ZEFjTnFJbTJIU295MVZHQQ==\"\n", "\n", "elasticsearch = Elasticsearch(\n", " # For local development\n", @@ -106,8 +106,8 @@ "metadata": {}, "outputs": [], "source": [ - "APP_SEARCH_ENDPOINT = getpass(\"App Search endpoint: \")\n", - "APP_SEARCH_PRIVATE_KEY = getpass(\"App Search private key: \")\n", + "APP_SEARCH_ENDPOINT = \"https://mjh-app-search-exporter-test-b64877.ent.us-central1.gcp.cloud.es.io\"\n", + "APP_SEARCH_PRIVATE_KEY = \"private-iubp52vt6sbc7g8vziwzhor2\"\n", "\n", "app_search = AppSearch(APP_SEARCH_ENDPOINT, bearer_auth=APP_SEARCH_PRIVATE_KEY)\n", "\n", @@ -335,7 +335,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -369,7 +369,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -425,7 +425,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -515,7 +515,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -545,7 +545,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -675,7 +675,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -741,7 +741,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -770,7 +770,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -989,7 +989,7 @@ "provenance": [] }, "kernelspec": { - "display_name": "Python 3", + "display_name": ".venv", "language": "python", "name": "python3" }, @@ -1003,7 +1003,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.9" + "version": "3.12.11" } }, "nbformat": 4, From b9685216d6bff40773dd450cebed9edac483d66f Mon Sep 17 00:00:00 2001 From: "Mark J. Hoy" Date: Sun, 19 Oct 2025 21:08:51 -0400 Subject: [PATCH 2/4] don't need (now deleted) keys (!) --- .../enterprise-search/app-search-engine-exporter.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/notebooks/enterprise-search/app-search-engine-exporter.ipynb b/notebooks/enterprise-search/app-search-engine-exporter.ipynb index 109b5239..b9ed07ec 100644 --- a/notebooks/enterprise-search/app-search-engine-exporter.ipynb +++ b/notebooks/enterprise-search/app-search-engine-exporter.ipynb @@ -73,10 +73,10 @@ "outputs": [], "source": [ "# https://www.elastic.co/search-labs/tutorials/install-elasticsearch/elastic-cloud#finding-your-cloud-id\n", - "ELASTIC_CLOUD_ID = \"mjh-app-search-exporter-test:dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlvOjQ0MyRlNzE4ZTY5ZTgyYzg0MzlkODMwMTRjMWJlYWIxZWZkMiRlZGUwMTE1MDM1ZjQ0ZjMxYTc5ZDU5MTRhZDQ1MWY1MA==\"\n", + "ELASTIC_CLOUD_ID = getpass(\"Elastic Cloud ID: \")\n", "\n", "# https://www.elastic.co/search-labs/tutorials/install-elasticsearch/elastic-cloud#creating-an-api-key\n", - "ELASTIC_API_KEY = \"Z2dpajVKa0I2UW56Zk9xYUtNT086cWNKbmw0ZEFjTnFJbTJIU295MVZHQQ==\"\n", + "ELASTIC_API_KEY = getpass(\"Elastic Api Key: \")\n", "\n", "elasticsearch = Elasticsearch(\n", " # For local development\n", @@ -106,8 +106,8 @@ "metadata": {}, "outputs": [], "source": [ - "APP_SEARCH_ENDPOINT = \"https://mjh-app-search-exporter-test-b64877.ent.us-central1.gcp.cloud.es.io\"\n", - "APP_SEARCH_PRIVATE_KEY = \"private-iubp52vt6sbc7g8vziwzhor2\"\n", + "APP_SEARCH_ENDPOINT = getpass(\"App Search endpoint: \")\n", + "APP_SEARCH_PRIVATE_KEY = getpass(\"App Search private key: \")\n", "\n", "app_search = AppSearch(APP_SEARCH_ENDPOINT, bearer_auth=APP_SEARCH_PRIVATE_KEY)\n", "\n", From 384b1f2f0ccf7ef74d2650973fd010b1595aca67 Mon Sep 17 00:00:00 2001 From: "Mark J. Hoy" Date: Sun, 19 Oct 2025 21:10:28 -0400 Subject: [PATCH 3/4] change python version back to 3.11.9 --- notebooks/enterprise-search/app-search-engine-exporter.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebooks/enterprise-search/app-search-engine-exporter.ipynb b/notebooks/enterprise-search/app-search-engine-exporter.ipynb index b9ed07ec..44e7f408 100644 --- a/notebooks/enterprise-search/app-search-engine-exporter.ipynb +++ b/notebooks/enterprise-search/app-search-engine-exporter.ipynb @@ -1003,7 +1003,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.11" + "version": "3.11.9" } }, "nbformat": 4, From cceea6703e31cf7cca542ac2377b1fb8e151fef6 Mon Sep 17 00:00:00 2001 From: "Mark J. Hoy" Date: Sun, 19 Oct 2025 21:11:27 -0400 Subject: [PATCH 4/4] change display name back --- notebooks/enterprise-search/app-search-engine-exporter.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebooks/enterprise-search/app-search-engine-exporter.ipynb b/notebooks/enterprise-search/app-search-engine-exporter.ipynb index 44e7f408..59f18205 100644 --- a/notebooks/enterprise-search/app-search-engine-exporter.ipynb +++ b/notebooks/enterprise-search/app-search-engine-exporter.ipynb @@ -989,7 +989,7 @@ "provenance": [] }, "kernelspec": { - "display_name": ".venv", + "display_name": "Python 3", "language": "python", "name": "python3" },