I'm currently updating my NEST client, which is deprecated, to the latest Elasticsearch client, Elastic.Clients.Elasticsearch. Previously, with NEST, I utilized the low-level client to create indexes from a JSON file containing mappings and settings, like so
var response = await this.client.LowLevel.Indices.CreateAsync(formattedIndexName, bytes, ctx: cancellationToken);
However, this functionality is not available in the latest client. What would be the recommended approach for achieving a similar outcome with the latest client?
please have a look at the very last paragraph in the migration guide:
It shows an example of how to use the low level transport. It's a little bit more work than what you've been doing before - but not that much. Besides the json payload, you must set the correct HTTP method and path for the endpoint and configure query parameters (these ones you probably don't need for your use-case).
The endpoint is documented here:
For your case, the method and path is PUT /my-index-000001 where my-index-000001 is the name of the index you want to create.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.