Skip to content

Fluent configuration of Remove processor on PutPipelineRequestDescriptor doesn't support field descriptor #8358

Open
@stevejgordon

Description

@stevejgordon

Is your feature request related to a problem? Please describe.
When creating an ingest pipeline in code, some processors support using the TDocument when configuring the Field to act on. Remove does not.

var putPipelineResponse = await es.Ingest.PutPipelineAsync<EncryptedAuthenticationSession>(pipelineName, p => p
    .Description("Adds geo IP and user agent information.")
    .Processors(pr => pr
        .Geoip(g => g.Field(f => f.RemoteIpAddress!).TargetField("geo_ip").IgnoreMissing())
        .UserAgent(u => u.Field(f => f.UserAgentString!).TargetField("user_agent").IgnoreMissing())
        .Remove(r => r.Field("user_agent_string"!))), ct);

See above, we can only provide a string, implicitly converted to Fields.

Describe the solution you'd like
Potentially, there's something amiss with the code generation, or we must manually add this to the partial class. It would be helpful if this processor acted like the others.

Describe alternatives you've considered
N/A

Additional context
Another slight developer experience issue I encountered is that when using the string to define the field, you get a nullability warning. This is due to the implicit conversion potentially returning null.

For example:
Image

I use the null forgiving operator in the preceding code snippet to avoid the warning. It would be nice not to have to do that. This might be achieved with additional nullability annotations on the implicit conversion operator.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions