I am trying to use the Nest client to create a custom class that can be instantiated with a default request. I am using the following code to create a boolean query that will become part of a default SearchRequest object.
var bq = new BoolQuery()
{
Filter = new QueryContainer[] { },
Must = new QueryContainer[] { },
MustNot = new QueryContainer[] { },
Should = new QueryContainer[] { }
};
The problem is if I return this as is I get a null object. If I add a default query such as a new MatchAll() query then the object comes back as expected.
Is there a workaround or flag to override this ? QueryContainer doesn't seem to have an IsStrict or Verbatim property to set.