How can I project fields in the Elasticsearch Net 8?
I tried:
SourceFilter filter = new SourceFilter();
filter.Includes = new List<Field>() .. hm not the way
SourceConfig sourceConfig = new SourceConfig(filter);
SearchResponse<PostDocument> searchResponse = await client.SearchAsync<PostDocument>(s => s
.Index(index_name)
.From(page)
.Size(countPerPage)
.Source(sourceConfig)
.Query(..)
Try 2
.Source(null).Fields(
fs => fs.Field(f => f.Id),
fs => fs.Field(f => f.PostId),
fs => fs.Field(f => f.Title))
I also saw SourceIncludes
which takes in Fields
but its not an expression same as the chain Fields
Any help? docs is still very limited