title: Searching through an alias with filter is very slow in Elasticsearch
body: <p>I have an elasticsearch index, <em>my_index</em>, with millions of documents, with key <em>my_uuid</em>. On top of that index I have several <strong>filtered aliases</strong> of the following form (showing only <em>my_alias</em> as retrieved by <code>GET my_index/_alias/my_alias</code>):</p>
  
  <pre><code>{
      "my_index": {
          "aliases": {
              "my_alias": {
                  "filter": {
                      "terms": {
                          "my_uuid": [
                              "0944581b-9bf2-49e1-9bd0-4313d2398cf6",
                              "b6327e90-86f6-42eb-8fde-772397b8e926",
                              thousands of rows...
                          ]
                      }
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>My understanding is that the filter will be cached transparently for me, without having to do any configuration. The thing is I am experiencing very slow searches, when going through the alias, which suggests that 1. <em>the filter is not cached</em>, or 2. <em>it is wrongly written</em>.</p>
  
  <p>Indicative numbers:</p>
  
  <pre><code>GET my_index/_search -&gt; 50ms 
  GET my_alias/_search -&gt; 8000ms
  </code></pre>
  
  <p>I can provide further information on the cluster scale, and size of data if anyone considers this relevant.</p>
  
  <p>I am using elasticsearch 2.4.1. I am getting the right results, it is just the performance that concerns me. </p>