DeleteByQuery Illegal state exception

Hi,
I'm testing this API and have this code:

        BulkByScrollResponse response =
            DeleteByQueryAction.INSTANCE.newRequestBuilder(m_client)
                    .filter(eventCondition.getQueryBuilder())
                    .get();

Which I copied from the documentation.

I got the following exception:

java.lang.IllegalStateException: failed to find action [org.elasticsearch.index.reindex.DeleteByQueryAction@5794e1cf] to execute
at org.elasticsearch.client.node.NodeClient.transportAction(NodeClient.java:116)
at org.elasticsearch.client.node.NodeClient.executeLocally(NodeClient.java:83)
at org.elasticsearch.client.node.NodeClient.doExecute(NodeClient.java:72)
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:404)
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:80)
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:54)
at org.elasticsearch.action.ActionRequestBuilder.get(ActionRequestBuilder.java:62)

Can someone please suggest why I'm seeing this?
Thanks

Did you use the PreBuiltTransportClient like this?

You are correct.
I did this test with an embedded node.
Once I moved to the PreBuiltTransportClient it worked.
I know embedded node is not supported but it's important to me to use it in this specific test.
Can you explain why it isn't working? And if there is something else I could be doing to use this API with the embedded node?

Thanks

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