Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SourceConfigConverter Write Method Throws NotImplementedException #7170

Closed
p-erk opened this issue Jan 17, 2023 · 3 comments · Fixed by #7182
Closed

SourceConfigConverter Write Method Throws NotImplementedException #7170

p-erk opened this issue Jan 17, 2023 · 3 comments · Fixed by #7182
Labels
8.x Relates to 8.x client version
Milestone

Comments

@p-erk
Copy link

p-erk commented Jan 17, 2023

Describe the feature:

When searching for nested hits in large documents, it is a common use case to exclude the source document from the responses.
This is accomplished by:
{
"query": {
"nested": {
"path": "paragraphs",
"query": {
"match" : {
"paragraphs.content": {"query":"Rating"}
}
},
"inner_hits": {}
}
},
"_source": false
}

This .net client provides the appropriate property in the constructor for the SearchRequest:
SearchRequest.Source which expects SourceConfig
which can also be constructed for the above usecase as
new SourceConfig(false)
Execuiting that request fails with a not implemented exception:

Elastic.Transport.UnexpectedTransportException: The method or operation is not implemented.
 ---> System.NotImplementedException: The method or operation is not implemented.
   at Elastic.Clients.Elasticsearch.Core.Search.SourceConfigConverter.Write(Utf8JsonWriter writer, SourceConfig value, JsonSerializerOptions options) in /_/src/Elastic.Clients.Elasticsearch/Types/SourceConfig.cs:line 63

which is indeed:

public override void Write(Utf8JsonWriter writer, SourceConfig value, JsonSerializerOptions options) => throw new NotImplementedException();

Please provide this simple converter.

@stevejgordon stevejgordon added the 8.x Relates to 8.x client version label Jan 23, 2023
@stevejgordon stevejgordon changed the title [Feature] SourceConfigConverter write not implemented [FEATURE] SourceConfigConverter write not implemented Jan 24, 2023
@p-erk
Copy link
Author

p-erk commented Jan 26, 2023

@stevejgordon what do you think of it?

@stevejgordon
Copy link
Contributor

@p-erk I haven't been able to look in detail at this yet but agree we need to resolve it. I will categorise this as a bug for attention in a future patch release.

@stevejgordon stevejgordon changed the title [FEATURE] SourceConfigConverter write not implemented SourceConfigConverter Write Method Throws NotImplementedException Jan 26, 2023
@p-erk
Copy link
Author

p-erk commented Jan 26, 2023

nice! thx :)

@stevejgordon stevejgordon added this to the 8.0.5 milestone Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.x Relates to 8.x client version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants