Please help me out with writing NEST query for below elastic DSL query
{
"query": {
"range": {
"date_of_birth": {
"format": "yyyy",
"gte": "1990",
"lte": "2020"
}
}
}
}
This is what I have written as of now but I am not able to correct it.
var format = "yyyy";
var lowerBound = DateTime.Now.AddYears(-1);
var searchResponse = elasticClient.Search<PresentationDetails>(s => s
.Index(indexAlias)
.Type("presentation")
.Size(1000)
.Source(source => source
.Includes(i => i
.Fields(
f => f.presentation_name
)
)
)
.Query(q => q
.Range( r => r.Field("date_of_birth").GreaterThanOrEquals(lowerBound)
)
)
.Scroll("20s")
);