Elasticsearch connection

Hello everyone,

I'm developing a custom plugin and I would like to connect to Elasticsearch side client, but the link I'm using (Elasticsearch service | Kibana Guide [8.7] | Elastic) is not working and the documentation is not up to date.
How can I connect to Elasticsearch and show data ?

Are you trying to access core.elasticsearch from inside a public directory, or from inside the server directory of your plugin?

It should be accessible from a plugin.ts inside the server directory.

I'm trying both approaches, but the core.elasticsearch object doesn't exist in the "public" directory. However, it does exist in the "server" directory. The problem is that when I access it from the "server" directory, it returns undefined.

My question is: Is it necessary to create a separate connection to Elasticsearch in my plugin, or is the Elasticsearch connection already configured by default?