Skip to content

SourceConfigConverter Write Method Throws NotImplementedException #7170

Closed
@p-erk

Description

@p-erk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    8.xRelates to a 8.x client version

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions