Retrieval augmented generation using Elasticsearch and OpenAI - Part 10
Index data into Elasticsearch
The following function generates the required bulk actions that can be passed to Elasticsearch's Bulk API, so we can index multiple documents efficiently in a single request.

For each row in the DataFrame, the function yields a dictionary representing a single document to be indexed.