Hi,
The following query is taking around 2s to complete. It seems very slow knowing that I will need to search for far more documents.
The query:
POST /mail_logs/_search
{
"fields": [
"MAIL_ID",
"SENDER",
"RECEIVER",
"STATUS",
"INSTANCE",
"SERVER"
],
"size":10000,
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"range" : {
"CREATEDTIME" : {
"gte":"2016-01-29 00:00:00",
"lt" :"2016-01-30 00:00:00"
}
}
},
{
"query": {
"query_string" : {
"default_field" : "STATUS.raw",
"query" : "sent OR bounced OR deferred OR \"Email moved into the appropriate queue\""
}
}
}
]
}
}
}
}
}
The response:
{
"took": 1968,
"timed_out": false,
"_shards": {
"total": 3,
"successful": 3,
"failed": 0
},
"hits": {
"total": 190090,
"max_score": 1,
"hits": [
...
]
}
}
Others information:
Elasticsearch 2.3.3
There is 10M documents in the index.
3 shards.
16GB RAM.
How can I improve the performance of my query?
Thank you.