查询回头客

时间:2019-07-12 11:35:38

标签: c# elasticsearch nest

我为同一位客户有两条记录,但有不同的customerLastUpdated日期,有没有办法只返回最近的一条?

var response = await this.client.SearchAsync<ElasticCustomer>(searchDescriptor => searchDescriptor
    .AllTypes()
    .Query(q => q.Bool(b => b
            .Should(
                sh => sh.Match(m => m.Field(f => f.CustomerName).Query(query)),
                sh => sh.Wildcard(w => w.Field(f => f.MobileNumber.Suffix("keyword")).Value($"*{query}*")))));

0 个答案:

没有答案