-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Elastic.Clients.Elasticsearch version: 8.11
Elasticsearch version:8.11
.NET runtime version:4.8
Operating system version:Win 11
Description of the problem including expected versus actual behavior:
When using the bulk API for delete, the index is not respected.
Example:
var request = new BulkRequest(indexName) { Refresh = Refresh.True };
foreach (var document in documents)
{
request.Operations.Add(new BulkDeleteOperation<SearchModel.Document>(document.IdentityField.Value.ToString()));
}
this.elasticClient.Bulk(request); // Results in error that there is no default index. The "indexName" is not used for some reason.
this.elasticClient.Bulk(b => b.Index(indexName).DeleteMany(documents)); // Same error. Even tough I am setting the "indexName", it is not respected.
For context, this works as expected for single document:
this.elasticClient.Delete(new DeleteRequest(indexName, documents.First().IdentityField.Value.ToString()));
Steps to reproduce:
- Create Elasticsearch client with valid connection
- Call the bulk delete API
Expected behavior
The documents are deleted from the passed index and no error is thrown
Provide ConnectionSettings
(if relevant):
Provide DebugInformation
(if relevant):