question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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 😃

Issue Analytics

  • State:open
  • Created 2 months ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nchetvertukhacommented, Jul 31, 2023

Thanks a lot!

1reaction
floberndcommented, Jul 31, 2023

Just want to mention the “official” way of achieving this:

var sd = new SearchRequestDescriptor<MyDocument>();
sd.SourceIncludes(new Expression<Func<MyDocument, object>>[] {
    x => x.Id,
    x => x.name
});

However, I agree that a direct overload might be a good idea and therefore leaving this issue open as a reminder.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · elastic/elasticsearch-net
[INFO] List of supported/unsupported APIs for current 8.x client ... [FEATURE] Source, SourceIncludes & SourceExcludes to support lambda targeting types ...
Read more >
Lambda event source mappings
Configure a Lambda event source mapping to invoke your function from queue and stream event sources, such as Amazon SQS, Kinesis, and DynamoDB....
Read more >
Using Lambda with self-managed Apache Kafka
Learn how to use a self-managed Apache Kafka cluster as an event source for Lambda.
Read more >
Lambda Expressions (The Java™ Tutorials > Learning ...
Lambda expressions enable you to do this, to treat functionality as method argument, or code as data. ... Target Types and Method Arguments....
Read more >
Lambda expressions and anonymous functions
You use a lambda expression to create an anonymous function. Use the lambda declaration operator => to separate the lambda's parameter list ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found