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代表。爲你 –