You are mixing so many questions that I can not follow.
There is no relationship between security feature:
in kibana for dashboard restriction we need X-pack that's we went to java api right
And the way you are going to request elasticsearch in Java.
we need to combine more condition and fetch record for ex: i have index(about bank details) in elasticsearch and client need a record from (last one hour transaction details AND the Gender should be Male) when these condition matches that record should be dispalyed For that How i need to do? your idea?
You need to learn elasticsearch first.
Forget everything about the Java client for now. Just start Elasticsearch and Kibana.
Then go to the developer Console and start playing with elasticsearch.
If you already indexed data, just use the GET /_search
endpoint to learn the QueryDSL.
Once you found the right query for your use case, then you can start to think about writing you code in Java. That's just another way to write a QueryDSL request.
If you need more help, please provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.
A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.