Java client 8 can't DELETE document

Using Java client version provided as Quarkus 3.7.1 extension. The following request ran in Kibana:

DELETE customers/_doc/69wID44Bdp9hpkBkyZ2a

works as expected. However, the code below:

    client.delete(DeleteRequest.of(dr -> dr.index(INDEX).id(id)));

where INDEX = "customers" and id = 69wID44Bdp9hpkBkyZ2a, raises the following exception:

Caused by: co.elastic.clients.elasticsearch._types.ElasticsearchException: [es/delete] failed: [http_status_405] Incorrect HTTP method for uri [/customers/_doc/] and method [DELETE], allowed: [POST]
    at co.elastic.clients.transport.ElasticsearchTransportBase.getApiResponse(ElasticsearchTransportBase.java:345)
    at co.elastic.clients.transport.ElasticsearchTransportBase.performRequest(ElasticsearchTransportBase.java:147)
    at co.elastic.clients.elasticsearch.ElasticsearchClient.delete(ElasticsearchClient.java:554)
    at fr.simplex_software.docstore.service.impl.CustomerServiceImpl.removeCustomerById(CustomerServiceImpl.java:68)
    at fr.simplex_software.docstore.service.impl.CustomerServiceImpl_ClientProxy.removeCustomerById(Unknown Source)
    at fr.simplex_software.docstore.api.impl.CustomerResourceImpl.deleteCustomerById(CustomerResourceImpl.java:64)

Not sure whether the issue is related to the Java client itself or to the Quarkus extension.

Please help. Many thanks in advance.
Kind regards,
Nicolas

That's weird because it looks like the id is not set.
What is the elasticsearch client version? What is the dependency tree?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.