I am developing application that uses ElasticSearch and SQL database. So, what is the best way to save users search queries and show statistics like what are the most popular requests? The simply way is to save in SQL database and count. But maybe there are some technique built in ElasticSearch?
There isn't currently a way to do that, ES doesn't track information to that level.
If you want to track queries you will need to put a proxy in front of ES.
Thank you for your reply.
What is proxy?
Your answer did not help me. I have not found any ideas/solutions/tips how proxy can be connected with ES, how to integrate/use proxy with ES and solve my problem.
I think that adding a proxy server would allow you to log the GET/POST requests made to elasticsearch. This link shows how to configure access logs in the NGINX server. https://www.nginx.com/resources/admin-guide/logging-and-monitoring/. Note that you would somehow need to get the body of these requests for a comprehensive record of the requests.
Alternatively, you could write/find a local service that would allow you to store requests to ES in ES, and later retrieve and execute them.