Default IndicesOptions in SearchRequest and disable specific deprecation warnings

Hi folks,

this is a follow-up to the automatically closed topic at Disable specific deprecation warnings.

We've updated to Elasticsearch 7.16.3 on the servers and for our clients now but still get this deprecation message without explicitly setting the ignore_throttled parameter in our search requests.

It turns out that the default IndicesOptions for SearchRequest include this by default:

Additionally, it's added to pretty much all requests anyway via the RequestConverters class:

How do other people handle this? Are you just ignoring the deprecation warnings in the logs on your Elasticsearch nodes? For us this is very annoying because we have a lot of requests going on and have gigabytes of just the deprecation message in our logs because of these defaults.

Or maybe are we "holding it wrong"? Should we use the Java client differently? If so, how would we "hold" it correctly?

So we aren't using the deprecated feature. It's added automatically for all of our requests with the (almost) latest version of Elasticsearch 7.16.3 and its corresponding Java client. How can we disable it?

Best regards,


You're using the deprecated high-level REST client, rather than the Java API client. It's unfortunate that there are so many Java clients in 7.x, there were good reasons for this but that doesn't make it any less confusing. I believe the new client should avoid deprecation warnings.

@DavidTurner Yes, we're using the Java High Level REST Client in version 7.16.3.

I would not have expected that it's causing the deprecation warning without any possibility whatsoever to disable it, either by not sending the deprecated parameter or by disabling the warning message.

So out of the box you cannot use Elasticsearch 7.16.x or later with the Java High Level REST Client without producing the deprecation warning, which makes up ~95% of log messages in our ES clusters. :exploding_head:

This forces us to do a big bang migration to the new Java client (which has hopefully matured enough by now) without giving the option to do a gradual migration, which we planned originally.
I found that a bit surprising for a "minor version" upgrade (7.15 -> 7.16). :frowning_face:

For reference, here's a pull request of a colleague of mine to avoid the deprecation warning without breaking backward compatibility in ES 7.x:

Maybe you could consider merging it for Elasticsearch 7.16.4 and onwards.

I've raised this with some of my colleagues who are taking a closer look. The 7.16 branch became unmaintained since the release of 7.17.0 so there won't be a 7.16.4, but it's possible this can be addressed in a later 7.17.x release.


Thanks a lot, David! :heart:

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