When I was testing the performance on 10 millions of docs, I found the performance was really bad at the beginning (~20s) but fast after thousands of search.
Then I use
_cat/segments?v=true to check my segments and the memory they cost, and found that "size.memory" are all 0! I think this is the reason that make my query so slow.
And I wonder how to set the configration to put the segments all in memory.