title: query vs filter and usage of correct expression in the query or filter
body: <p>I've seen lots of questions in S.O as well as reading the documentation about "filters are cached" while queries are not cached and that "queries are applied on all values" and "filters are applied after queries if outside the query object" etc.</p>
  
  <p>Bottom line is that the documentation sucks and the DSL is very difficult to grasp. I'm trying to optimize some queries and using the kibana dev tools search profiler, but my local data sets must be too small to measure the actual performance difference (I'm getting results in both directions) and I don't have a test cluster with multiple nodes to work against on a real and large data set.</p>
  
  <p>In this trivial case, all queries will return the same results. I want to understand the difference and why would you prefer a query rather than a filter in any cases that would allow to place the clause in a filter instead</p>
  
  <pre><code>GET foo11/_search
  {
    "query": {
      "bool": {
        "filter": {
          "match" : {
            "in_stock" : true
          }
        }
      }
    }
  }
  
  GET foo11/_search
  {
    "query": {
      "bool": {
        "filter": {
          "term" : {
            "in_stock" : true
          }
        }
      }
    }
  }
  
  
  GET foo11/_search
  {
    "query": {
      "bool": {
        "must": {
          "match" : {
            "in_stock" : true
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>what is the difference in these 3 cases in the performance? Can I actually prove that one is better/worse than the other?</p>
  
  <p>What is the difference between:</p>
  
  <pre><code>"match" : {
    "in_stock" : true
  }
  </code></pre>
  
  <p>vs </p>
  
  <pre><code>"term" : {
    "in_stock" : true
  }
  </code></pre>