WARNING: Version 5.x has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Some URIs in Elasticsearch take a
Within NEST, route values on the URI are represented as classes that implement an interface,
Since enums cannot implement interfaces in C#, a route parameter that would be of type
Feature is represented using the
Features class that
Feature enum implicitly converts to.
Features constructor directly is possible but rather involved
Features fieldString = Feature.Mappings | Feature.Aliases; Expect("_mappings,_aliases") .WhenSerializing(fieldString);
Here we new an GET index elasticsearch request which takes Indices and Features. Notice how we can use the Feature enum directly.
var request = new GetIndexRequest(All, Feature.Settings);