ElasticClient.Raw已重命名为
ElasticClient.LowLevel。
这是您可以在NEST 2.x中编写请求的方式。
_elastic.Client.LowLevel.IndicesCreate<object>(indexName, File.ReadAllText("index.json"));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" } } } } }}希望能帮助到你。



