I have built and up an elasticsearch on my computer. And set the
xpack.security.enabled: true
xpack.security.authc.api_key.enabled: true
to enable basic security. The elastic username password is also generated automatically.
Now I need to access the 127.0.0.1:9200 with java API, how can I do that? If any example or demo provided is better.