简体   繁体   English

C#/。net使用者的Elasticsearch范围查询选项

[英]Elasticsearch range query option for C#/.net consumer

I am using Nest to query elasticsearch to fetch a list of documents that belong in a certain date range. 我正在使用Nest来查询elasticsearch以获取属于特定日期范围的文档列表。 This is what I have but I am not sure how to change it to provide date range. 这就是我所拥有的,但是我不确定如何更改它以提供日期范围。

var searchResults = elasticSearchClient
    .Search<Product>(s => s.From(0)
        .Size(10)
        .Query(q => q.Term(p => p.SellDate.....)));

I want to filter results so that I get the data with "SellDate" in the last 24 hours. 我想过滤结果,以便在过去24小时内使用“ SellDate”获取数据。

类似于以下内容:

q => q.Range(v => v.OnField("myDocs.SellDate").From(fromRange).To(toRange))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM