diff --git a/supporting-blog-content/building-elasticsearch-apis-with-fastapi-websockets/README.md b/supporting-blog-content/building-elasticsearch-apis-with-fastapi-websockets/README.md index 825f761a..fb52be2d 100644 --- a/supporting-blog-content/building-elasticsearch-apis-with-fastapi-websockets/README.md +++ b/supporting-blog-content/building-elasticsearch-apis-with-fastapi-websockets/README.md @@ -25,7 +25,28 @@ python3 -m venv venv pip install -r requirements.txt ``` -4. **Run the API with uvicorn:** +4. **Set up Elasticsearch credentials:** + +Set your Elasticsearch endpoint and API key as environment variables: + +```bash +export ELASTICSEARCH_ENDPOINT="your-elasticsearch-endpoint" +export ELASTICSEARCH_API_KEY="your-elasticsearch-api-key" +``` + +5. **Create the index and load data:** + +Run the ingest script to create the products index and load the sample data: + +```bash +python ingest_data.py +``` + +This will: +- Create the `products` index with the proper mapping +- Load all products from `products.ndjson` into Elasticsearch + +6. **Run the API with uvicorn:** ```bash uvicorn main:app --reload diff --git a/supporting-blog-content/building-elasticsearch-apis-with-fastapi-websockets/index.html b/supporting-blog-content/building-elasticsearch-apis-with-fastapi-websockets/index.html index 273f624c..4badaded 100644 --- a/supporting-blog-content/building-elasticsearch-apis-with-fastapi-websockets/index.html +++ b/supporting-blog-content/building-elasticsearch-apis-with-fastapi-websockets/index.html @@ -4,51 +4,88 @@