我想为(多个循环)创建批量api请求
{ "index" : { "_index" : "idx_name", "_type" : "doc", "_id" : ".."} }
{"field": "value"}
到目前为止,我已经完成了:
{ "index" : { "_index" : "idx_name", "_id" : ".."} }
{"field": "value"}
通过使用:
DefaultMappingFor<classname>(m => m
.IndexName("idx_name"));
和
client.Bulk(b => b
.Index<classname>( i => i
.Id(Guid.NewGuid())
.Document(documents) //doc is a field of the class
));
我想使用NEST添加_type:“ doc”字段。请帮忙。
您不需要,因为mapping types are deprecated将被删除。
您只需要指定索引名称和文档ID,就可以了。