Slow searches on a cluster

Hey,

each machine has 30GB RAM for ES_HEAP_SIZE, and the rest is left for the OS

an example for a query without aggregation:

GET records/_search
{
"size": 1000
, "query": {
"filtered": {
"filter": {
"term": {
"phoneNumber": "05801001590"
}
}
}
}
}

phone number is type string, this query took 6000 ms

This is the 2 aggregations query:

GET records/_search
{
"aggs": {
"by_id": {
"terms": {
"field": "entityId",
"size": 5,
"order": {
"_count": "desc"
}
},
"aggs": {
"by_name": {
"terms": {
"field": "name",
"size": 1
}
}
}
}
}
}

this query took 30000 ms

each record has an ID, Name, Phone and some other fields (this is version 2.3.1 so by default all fields are default doc_value)