From 9195b22667fcd81eacd97baaa33becb062a04fc6 Mon Sep 17 00:00:00 2001 From: Rodney Norris Date: Fri, 12 Apr 2024 07:21:18 -0500 Subject: [PATCH] [Search] Update notebooks & search_notebooks readme (#180630) --- x-pack/plugins/search_notebooks/README.mdx | 12 ++++++++++++ .../search_notebooks/server/data/00_quick_start.json | 2 +- .../server/data/01_keyword_querying_filtering.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/search_notebooks/README.mdx b/x-pack/plugins/search_notebooks/README.mdx index c1429a0c598ab..756915cadbb4d 100755 --- a/x-pack/plugins/search_notebooks/README.mdx +++ b/x-pack/plugins/search_notebooks/README.mdx @@ -1,3 +1,15 @@ # Search Notebooks plugin This plugin contains endpoints and components for rendering search python notebooks in the persistent dev console. + +### Cached Notebooks + +There is a limited set of search notebooks that we cache in `/server/data` directory to be served from this plugin. These should be available in all environments. + +To update the cached notebooks, run the following command: + +```shell +./scripts/download-notebooks.sh +``` + +This script reads the `scripts/notebooks.txt` file and downloads each notebook from the url in the file and then saves it in the `server/data` directory with a snake_case filename and `.json` extension. The `.json` extension is just to make loading the files with node.js easier using an `async require()` instead of writing custom loading code with `fs` and implementing in-memory caching with the same loading code. diff --git a/x-pack/plugins/search_notebooks/server/data/00_quick_start.json b/x-pack/plugins/search_notebooks/server/data/00_quick_start.json index 3462ab9ff5f10..bb5ee71326683 100644 --- a/x-pack/plugins/search_notebooks/server/data/00_quick_start.json +++ b/x-pack/plugins/search_notebooks/server/data/00_quick_start.json @@ -9,7 +9,7 @@ "source": [ "# Semantic search quick start\n", "\n", - "\"Open\n", + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/elastic/elasticsearch-labs/blob/main/notebooks/search/00-quick-start.ipynb)\n", "\n", "This interactive notebook will introduce you to some basic operations with Elasticsearch, using the official [Elasticsearch Python client](https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/connecting.html).\n", "You'll perform semantic search using [Sentence Transformers](https://www.sbert.net) for text embedding. Learn how to integrate traditional text-based search with semantic search, for a hybrid search system." diff --git a/x-pack/plugins/search_notebooks/server/data/01_keyword_querying_filtering.json b/x-pack/plugins/search_notebooks/server/data/01_keyword_querying_filtering.json index 84f1830ecebf0..308b65782a379 100644 --- a/x-pack/plugins/search_notebooks/server/data/01_keyword_querying_filtering.json +++ b/x-pack/plugins/search_notebooks/server/data/01_keyword_querying_filtering.json @@ -8,7 +8,7 @@ "source": [ "# Keyword querying and filtering\n", "\n", - "\"Open\n", + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/elasticsearch-labs/blob/main/search/01-keyword-querying-filtering.ipynb)\n", "\n", "This interactive notebook will introduce you to the basic Elasticsearch queries, using the official Elasticsearch Python client. Before getting started on this section you should work through our [quick start](https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/search/00-quick-start.ipynb), as you will be using the same dataset." ]