anchor.diff:  // CONSOLE
   // TEST[continued]
   
  -Let's now introduce the {ref}/query-dsl-bool-query.html[`bool` query]. The `bool` query allows us to compose smaller queries into bigger queries using boolean logic.
  -
  -This example composes two `match` queries and returns all accounts containing "mill" and "lane" in the address:
  -
  -[source,js]
  ---------------------------------------------------
  -GET /bank/_search
  -{
  -  "query": {
  -    "bool": {
  -      "must": [
  -        { "match": { "address": "mill" } },
  -        { "match": { "address": "lane" } }
  -      ]
  -    }
  -  }
  -}
  ---------------------------------------------------
  -// CONSOLE
  -// TEST[continued]
  -
  -In the above example, the `bool must` clause specifies all the queries that must be true for a document to be considered a match.
  -
  -In contrast, this example composes two `match` queries and returns all accounts containing "mill" or "lane" in the address:
  -
  -[source,js]
  ---------------------------------------------------
  -GET /bank/_search
  -{
  -  "query": {
  -    "bool": {
  -      "should": [
  -        { "match": { "address": "mill" } },
  -        { "match": { "address": "lane" } }
  -      ]
  -    }
  -  }
  -}
  ---------------------------------------------------
  -// CONSOLE
  -// TEST[continued]
  -
  -In the above example, the `bool should` clause specifies a list of queries either of which must be true for a document to be considered a match.
  -
  -This example composes two `match` queries and returns all accounts that contain neither "mill" nor "lane" in the address:
  -
  -[source,js]
  ---------------------------------------------------
  -GET /bank/_search
  -{
  -  "query": {
  -    "bool": {
  -      "must_not": [
  -        { "match": { "address": "mill" } },
  -        { "match": { "address": "lane" } }
  -      ]
  -    }
  -  }
  -}
  ---------------------------------------------------
  -// CONSOLE
  -// TEST[continued]
  -
  -In the above example, the `bool must_not` clause specifies a list of queries none of which must be true for a document to be considered a match.
  -
  -We can combine `must`, `should`, and `must_not` clauses simultaneously inside a `bool` query. Furthermore, we can compose `bool` queries inside any of these `bool` clauses to mimic any complex multi-level boolean logic.
  -
  -This example returns all accounts of anybody who is 40 years old but doesn't live in ID(aho):
  +To construct more complex queries, you can use a `bool` query to combine
  +multiple query criteria. You can designate criteria as required (must match), 
  +desirable (should match), or undesirable (must not match).
  +
  +For example, the following request searches the `bank` index for accounts that
  +belong to customers who are 40 years old, but excludes anyone who lives in
  +Idaho (ID):
   
   [source,js]
   --------------------------------------------------
  
positive.code: // CONSOLE
  // TEST[continued]
  
  Dissecting the above, the bool query contains a `match_all` query (the query part) and a `range` query (the filter part). We can substitute any other queries into the query and the filter parts. In the above case, the range query makes perfect sense since documents falling into the range all match "equally", i.e., no document is more relevant than another.
  
  In addition to the `match_all`, `match`, `bool`, and `range` queries, there are a lot of other query types that are available and we won't go into them here. Since we already have a basic understanding of how they work, it shouldn't be too difficult to apply this knowledge in learning and experimenting with the other query types.
  
  [[getting-started-aggregations]]
  == Analyze results with aggregations
  
  Aggregations provide the ability to group and extract statistics from your data. The easiest way to think about aggregations is by roughly equating it to the SQL GROUP BY and the SQL aggregate functions. In Elasticsearch, you have the ability to execute searches returning hits and at the same time return aggregated results separate from the hits all in one response. This is very powerful and efficient in the sense that you can run queries and multiple aggregations and get the results back of both (or either) operations in one shot avoiding network roundtrips using a concise and simplified API.
  
  To start with, this example groups all the accounts by state, and then returns the top 10 (default) states sorted by count descending (also default):
  
  [source,js]
  --------------------------------------------------
  
negative.code:   },
    "hits" : {
      "total" : 1000,
      "max_score": null,
      "hits" : [ {
        "_index" : "bank",
        "_type" : "_doc",
  