Timeout long running indexing query

Is there way to timeout a long running indexing query? I have done something like this:

UpdateResponse resp = updateIndex.execute().actionGet(30000);

OR

BulkResponse bulkResponse = bulkRequest.execute().actionGet(30000);

But I still see queries running beyond this time and there is no exception generated. I am sure I am missing something or doing it incorrectly.

Any pointers on how can this be addressed?

You can timeout the connection that requests the search, but there is currently no way in ES to tell it to cancel a query that has run beyond a given time.

How can I timeout the connection? is it the way I have done above?