Fields option using NEST

When using the Fieds options just to get a selection of fileds using the NEST client library and setting the Source(false), the Hits object's fields property is null. How are we supposed to get access to the values returned if source is also null by setting Source(false).


var searchResponse =
await ElasticSearchConfig.GetClient().SearchAsync(x => x.Index(indices)
.Source(sr => sr
.Includes(fi => fi
f => f.Id,
f => f.Name,
f => f.Age,
f => f.Address,
f => f.DateRegistered
.Query(q => q
.Bool(bq =>
fq => fq.DateRange(t => t.Field(f => f.DateRegistered).LessThanOrEquals(DateTimeOffset.UtcNow.AddDays(7).ToString("o"))))

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