elasticsearch-net icon indicating copy to clipboard operation
elasticsearch-net copied to clipboard

[FEATURE] Source, SourceIncludes & SourceExcludes to support lambda targeting types & list

Open TheFireCookie opened this issue 11 months ago • 10 comments

Is your feature request related to a problem? Please describe. I'm frustrated upgrading from 7 to 8 because in the include/exclude & general source filtering in NEST, we could work with lambda pointing to properties of a specific document (mydoc => mydoc.MyField), in the new ES8 client, we can only work with list of strings and the mapping is not easy.

NEST:

gd => gd.SourceIncludes(doc=> doc.Id, doc=> doc.CreationDate)

Describe the solution you'd like Handling of the list (in addition of array etc) on the Fields class

var esIncludeFields = new List<string> { "id", "type" };
new SearchRequestDescriptor<TDoc>()
.SourceIncludes(esIncludeFields)

Handling of the .NET lambda targeting type properties

new SearchRequestDescriptor<TDoc>()
.SourceIncludes(doc => doc.Id, doc => doc.CreationDate)

Describe alternatives you've considered Right now I'm using workaround of course :)

TheFireCookie avatar Jul 12 '23 12:07 TheFireCookie