Elasticsearch cluster
Master node : 1 (16cpus, 128GB RAM) - 32GB is allocated for HEAP
Data nodes : 6 (each node 16cpus, 128GB RAM) - 32GB is allocated for
HEAP for all nodes
Indices : 9
Total documents : 48,826,456
Stored size : 2TB
This query is very slow. Takes around 4seconds
I have profiled it and found terms profile_id in the filter is slow, Since terms array contains around 20k ids. Without terms
it takes around 700ms
Any suggestion to improve the performance will be grateful.