我正在尝试使用 NEST 客户端使用批量 API。如何根据集合的属性指定 TTL 值。考虑以下代码片段,我如何指定“ttl”来表示 person.Age > 50 --> 1 个月,否则为 6 个月?:
var coll = new List<Person>();
// fill the collection from db etc...
var desc = new BulkDescriptor();
foreach(var p in coll)
{
// desc.Index<Person>( .... );
// How can I say, "if person.Age > 50, ttl = 1 month, otherwise 6 months?
}
var result = client.Bulk(desc);