ElasticSearch.NET query serialization

Hi, I wonder if there is a public serializer or converter for QueryContainer object.

var query = Query<Project>.DateRange(r => r
                    .Field(f => f.StartedOn)
                    .GreaterThanOrEquals(new DateTime(2003, 01, 01))
                    .LessThan(new DateTime(2009, 01, 01))
            );

I want something like

var json = JsonConvert.SerializeObject(query);

{
    "query" : {
         "range": {
            "startedOn": {
              "lt": "2009-01-01T00:00:00",
              "gte": "2003-01-01T00:00:00"
            }
          }
     }
}

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