ElasticClient.Rawwas renamed to ElasticClient.LowLevel.
Here is how you can compose your request in NEST 2.x.
_elastic.Client.LowLevel.IndicesCreate<object>(indexName, File.ReadAllText("index.json"));
File contents index.json:
{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 1
},
"analysis" : {
"analyzer" : {
"analyzer-name" : {
"type" : "custom",
"tokenizer" : "keyword",
"filter" : "lowercase"
}
}
},
"mappings" : {
"employeeinfo" : {
"properties" : {
"age" : {
"type" : "long"
},
"experienceInYears" : {
"type" : "long"
},
"name" : {
"type" : "string",
"analyzer" : "analyzer-name"
}
}
}
}
}
}
Hope this helps.
source
share