title: ElasticSearch ignoring sort when filtered
body: <p>ElasticSearch Version: 0.90.1, JVM: 1.6.0_51(20.51-b01-457)</p>
  
  <p>I'm trying to do two things with my ElasticSearch query:  1) filter the results based on a boolean (searchable) and "open_date &lt; tomorrow" and 2) two sort by the field "open_date" DESC</p>
  
  <p>This produces the following query:</p>
  
  <pre><code>{
    "query": {
      "bool": {
        "should": [
          {
            "prefix": {
              "name": "foobar"
            }
          },
          {
            "query_string": {
              "query": "foobar"
            }
          },
          {
            "match": {
              "name": {
                "query": "foobar"
              }
            }
          }
        ],
        "minimum_number_should_match": 1
      },
      "filtered": {
        "filter": {
          "and": [
            {
              "term": {
                "searchable": true
              }
            },
            {
              "range": {
                "open_date": {
                  "lt": "2013-07-16"
                }
              }
            }
          ]
        }
      }
    },
    "sort": [
      {
        "open_date": "desc"
      }
    ]
  }
  </code></pre>
  
  <p>However, the results that come back are not being sorted by "open_date".  If I remove the filter:</p>
  
  <pre><code>{
    "query": {
      "bool": {
        "should": [
          {
            "prefix": {
              "name": "foobar"
            }
          },
          {
            "query_string": {
              "query": "foobar"
            }
          },
          {
            "match": {
              "name": {
                "query": "foobar"
              }
            }
          }
        ],
        "minimum_number_should_match": 1
      }
    },
    "sort": [
      {
        "open_date": "desc"
      }
    ]
  }
  </code></pre>
  
  <p>... the results come back as expected.</p>
  
  <p>Any ideas?</p>