0

I am using Nest to query elasticsearch to fetch a list of documents that belong in a certain date range. 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.

1 Answer 1

1

Something like the following:

q => q.Range(v => v.OnField("myDocs.SellDate").From(fromRange).To(toRange))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.