Skip to content

[FEATURE] Elastic 8 Client - Delete Many By Ids #8484

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

Closed
DR9885 opened this issue Apr 1, 2025 · 3 comments
Closed

[FEATURE] Elastic 8 Client - Delete Many By Ids #8484

DR9885 opened this issue Apr 1, 2025 · 3 comments

Comments

@DR9885
Copy link

DR9885 commented Apr 1, 2025

Is your feature request related to a problem? Please describe.
Currently no easy way to delete a list of Ids.

Describe the solution you'd like

        var res = await _client.BulkAsync(
            b =>
                b.Index(_dbName)
                    .DeleteMany(ids), ct).ConfigureAwait(false);

Describe alternatives you've considered
Current work around but this does not seem ideal.

        var res = await _client.BulkAsync(
            b =>
            {
                b.Index(_dbName);
                foreach (var id in ids)
                    b.Delete<TE>(x => x.Id(id));
        
            }, ct).ConfigureAwait(false);

Additional context
N/A

@flobernd
Copy link
Member

flobernd commented Apr 1, 2025

Hi @DR9885 ,

the BulkRequestDescriptor already provides this overload:

DeleteMany(IndexName index, IEnumerable<Id> ids)

Under the hood, it does exactly what you currently have as your "workaround" code.

Please let me know, if that solves you issue.

Copy link
Contributor

github-actions bot commented Apr 7, 2025

This issue is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 2 days.

Copy link
Contributor

This issue was closed because it has been stalled for 2 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants