title: Query elastic search with many levels of "bool query"
body: <p>I am trying to implement a search system with ElasticSearch.
  My problem lies in the location of objects First, the searched objects can have different type of location:</p>
  
  <ul>
  <li>Country</li>
  <li>Country + State</li>
  <li>Country + State  + District</li>
  </ul>
  
  <p>Here is an example:</p>
  
  <pre><code>Country = A
  State = B
  District = C
  
  Currently I get all the objects that have the location :
  Country = A and State = B and District = C
  
  I want also find objects which have the location:
  only Country = A
  and
  only Country = A and State = B
  </code></pre>
  
  <p>It's a bit complicated to explain but the principle is.</p>
  
  <p>So I created the following query ElasticSearch :</p>
  
  <pre><code>"query" : {
          [{"bool":{
              "should":[
                  {"bool":{
                       "must":[
                           {"match":{"country":"-223"}},
                           {"match":{"state":"-3760"}},
                           {"match":{"district":"-8245"}}
                       ]
                  }},
                  {"bool":{
                       "must":[
                           {"match":{"country":"-223"}},
                           {"match":{"state":"-3760"}},
                           {"match":{"district":""}}
                        ]
                  }},
                  {"bool":{
                       "must":[
                           {"match":{"country":"-223"}},
                           {"match":{"state":""}},
                           {"match":{"district":""}}
                        ]
                  }}
              ]
          }}]
    } 
  </code></pre>
  
  <p>But it does not work, I do not really know what I've done wrong.
  I read the documentation on this site:</p>
  
  <p><a href="http://www.elasticsearch.org/guide/reference/query-dsl/bool-query/" rel="nofollow">http://www.elasticsearch.org/guide/reference/query-dsl/bool-query/</a></p>
  
  <p>And I try all that seemed useful for my problem but without success
  Is someone can help me find what's wrong?</p>
  
  <p>Thank you F.</p>