I'm using elasticsearch version 6.4.
An index pri.store.size is 25GB and it contains 47 Million documents.
My query includes a termsquery and cardinality.
When i execute the query using CURL i got the response in 3-4 seconds.
But when the same query is executed by RestClient java api, i got the exception
java.io.IOException: listener timeout after waiting for  ms.
Then i increased my setMaxRetryTimeoutMillis to 60000. Still timeout happened. Then further to 90 seconds, 2 minute, 10 min, 20 min. I failed every time.
What i'm missing?
Simple queries are executed successfully via RestClient. But a query with termsquery and cardinality timesout everytime (only RestClient fails but CURL returns response)
Help me to achieve via RestClient.