kibana/x-pack/plugins/search_notebooks
Kibana Machine 5d9cdf8dae
[8.x] search_notebooks: update notebooks Oct 1, 2024 (8.16) (#194603) (#194747)
# Backport

This will backport the following commits from `main` to `8.x`:
- [search_notebooks: update notebooks Oct 1, 2024 (8.16)
(#194603)](https://github.com/elastic/kibana/pull/194603)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Rodney
Norris","email":"rodney.norris@elastic.co"},"sourceCommit":{"committedDate":"2024-10-02T16:54:11Z","message":"search_notebooks:
update notebooks Oct 1, 2024 (8.16) (#194603)\n\n##
Summary\r\n\r\nUpdating the cached search notebooks prior to
8.16","sha":"1b050074b9691b4e0ba05d07a6b5a118d878fe6d","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Search","backport:prev-minor"],"title":"[Search][Notebooks]
update notebooks Oct 1, 2024
(8.16)","number":194603,"url":"https://github.com/elastic/kibana/pull/194603","mergeCommit":{"message":"search_notebooks:
update notebooks Oct 1, 2024 (8.16) (#194603)\n\n##
Summary\r\n\r\nUpdating the cached search notebooks prior to
8.16","sha":"1b050074b9691b4e0ba05d07a6b5a118d878fe6d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194603","number":194603,"mergeCommit":{"message":"search_notebooks:
update notebooks Oct 1, 2024 (8.16) (#194603)\n\n##
Summary\r\n\r\nUpdating the cached search notebooks prior to
8.16","sha":"1b050074b9691b4e0ba05d07a6b5a118d878fe6d"}}]}] BACKPORT-->

Co-authored-by: Rodney Norris <rodney.norris@elastic.co>
2024-10-02 13:36:19 -05:00
..
common [Search][Notebooks] allow pre-selecting a specific notebook (#189825) 2024-08-05 15:00:35 -05:00
public [Search][Notebooks] allow pre-selecting a specific notebook (#189825) 2024-08-05 15:00:35 -05:00
scripts
server [8.x] search_notebooks: update notebooks Oct 1, 2024 (8.16) (#194603) (#194747) 2024-10-02 13:36:19 -05:00
jest.config.js
kibana.jsonc [Search] Notebooks Telemetry (#188007) 2024-07-11 09:40:41 +02:00
package.json
README.mdx
tsconfig.json [Search] Notebooks Telemetry (#188007) 2024-07-11 09:40:41 +02:00

# 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.