# Elastic Search Date Range Filter lambda expression issue

**URL:** <https://discuss.elastic.co/t/elastic-search-date-range-filter-lambda-expression-issue/165863>\
**Category:** Elasticsearch\
**Created:** [January 26, 2019, 8:16pm UTC](https://discuss.elastic.co/t/elastic-search-date-range-filter-lambda-expression-issue/165863 "2019-01-26T20:16:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Gathairu](https://avatars.discourse-cdn.com/v4/letter/j/6de8d8/32.png) [@John\_Gathairu](https://discuss.elastic.co/u/John_Gathairu)\
**Post date:** [January 26, 2019, 8:16pm UTC](https://discuss.elastic.co/t/elastic-search-date-range-filter-lambda-expression-issue/165863/1 "2019-01-26T20:16:33Z")

</div>

part of the index looks like this "startdate" : "2018-11-01T00:00:00", "enddate" : "2018-11-01T00:00:00" My fluentAPI query looks like below

var response = client.Search(x =\> x .Size(500) .Query(q =\> q.Bool(b =\> b.Must (mu =\> mu.MultiMatch(m =\> m .Fields(n =\> n.Fields(f =\> f.User, f =\> f.Activity , f =\> f.County, f =\> f.Constituency, f =\> f.Country , f =\> f.ActivityRequestDescription, f =\> f.ActivityDescription, f =\> f.LessonsLearnt, f =\> f.Challenges, f =\> f.Recommendatinons, f =\> f.User , f =\> f.Venue, f =\> f.Division)) .Query( **search** ))) . **Filter** (fi =\> fi .DateRange(r =\> r .Field(f =\> f.StartDate) .GreaterThan("2018-08-20") .LessThanOrEquals(DateMath.Now) )))));

The query runs well and return results **WITHOUT** filter. After I add filter as shown above the query returns no results. Can anyone point the problem with the fluentAPI code

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 23, 2019, 8:16pm UTC](https://discuss.elastic.co/t/elastic-search-date-range-filter-lambda-expression-issue/165863/2 "2019-02-23T20:16:36Z")

</div>

Closed on February 23, 2019, 8:16pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
