0
在我的ElasticSearch数据库上,我需要从插入查询(我正在使用.NET C#)中获取自动生成的ID。怎么做?我试着调试readRecords响应,但我没有找到这样的ID。ElasticSearch - 如何从插入查询中获取自动生成的ID
基本上我需要相当于MySQL LAST_INSERT_ID()
的命令。
var readRecords = elasticClient.Search<HistoryRecord>(s => s
.Index(elasticIndexName)
.Filter(f =>
f.Term(t => t.MacAddr, historyRecord.MacAddr) &&
f.Term(t => t.GroupName, historyRecord.GroupName) &&
f.Term(t => t.GroupNo, historyRecord.GroupNo) &&
f.Term(t => t.InstrType, historyRecord.InstrType) &&
f.Term(t => t.InstrumentAddress, historyRecord.InstrumentAddress) &&
f.Term(t => t.InstrumentName, historyRecord.InstrumentName) &&
f.Term(t => t.UhhVersion, historyRecord.UhhVersion))).Documents
谢谢! +1代表。为你 –