Hi guys,
I need to identify each elasticsearch query in the reverse proxy for elasticsearch (the reverse proxy is developed in java, just to throttle the requests to ES and do some user statistics), if it's expensive query, only limited users can perform at a specific rate limit.
What is difficult to me is how to identify the expensive queries. I know that there is a switch for elasticsearch, can disable / enable the expensive queries by setting this parameter.
But I read elasticsearch source code, haven't found how the elasticsearch identify different kinds of expensive queries.
I want to confirm:
1. Is there any elasticsearch API (from elasticsearch client sdk) that can identify expensive queries ?
2. If not, do you know what's the effective way to identify expensive queries by analysis the query body ? by some AST (Abstract Syntax Tree) resolver ? Or by search specific keywords in the query body ?
I'd really appreciate some help on this!