Advanced Search: Add query impact score
Background
Currently, we can't estimate if an Advanced Search query is an expensive one, which might cause performance issues.
Proposal
We could introduce a score to every query. For example, we can start with:
(<number of routing keys> / <total number of shards>) * ((<number of OR operators> + <number of wildcards> + 1)^3) * 100
Then, if we detect an expensive query, we can return an error early. This feature should probably be behind a new setting.