Hi,
I have a strange problem with ElasticSearch.
ElasticSearch is setup with number of indexes rotated on a daily basis (eg:
20120416-logs) for collecting logs from a large number of servers (~2GB/day
currently).
On top of that I've setup a 'logs' alias which allows me to query all of
the indexes.
It seems that if I don't make a query on ElasticSearch for a few days, when
I do the first one will always take a very long time / timeout.
Subsequent queries run fine.
The example below shows me searching for a random string that I know won't
appear in any of the indexes.
It doesn't seem to make any difference whether the string exists in the
indexes or not - or if it changes between searches.
It just seems that the first query is always slow.
Is there some batch process I can run on a regular basis to stop this
happening? Am I doing something wrong?
[paul@macbook ~]$ curl -XGET
'http://logs1:9200/logs/message/_search?q=apegjaegpojaeg'
{"took":7387,"timed_out":false,"_shards":{"total":13,"successful":13,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
[paul@macbook ~]$ curl
-XGET 'http://logs1:9200/logs/message/_search?q=apegjaegpojaeg'
{"took":16,"timed_out":false,"_shards":{"total":13,"successful":13,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
[paul@macbook ~]$ curl -XGET 'http://logs1:9200/logs/message/_search?q=open'
{"took":22,"timed_out":false,"_shards":{"total":13,"successful":13,"failed":0},"hits":{"total":94769,"max_score":1.1631737,"hits":[
<< HITS REMOVED FOR PRIVACY >>}}]}