title: How to combine "must" and "should" in Elasticsearch query?
body: <p>I need to "translate" this pseudo-SQL query in Elasticsearch query DSL:</p>
  
  <blockquote>
    <p>select from invoice where invoiceType = 'REGULAR' and receiver =
    'CUSTOMER' and (invoiceStatus = 'DISPATCHED' or invoiceStatus = 'PAYED')</p>
  </blockquote>
  
  <p>I have this:</p>
  
  <pre><code>{
    "query": {
      "bool": {
        "must": [
          { "match": { "invoiceType":  "REGULAR" }},
          { "match": { "receiver": "CUSTOMER" }},
          { "bool" : {
              "should": [
                  {"match" : {"invoiceStatus": "DISPATCHED"}},
                  {"match" : {"invoiceStatus": "PAYED"}}
              ]
            }
          }
        ]
      }
    }
  }
  </code></pre>
  
  <p>That query is returning 0 results, but I know there are many that matches what I'm searching for. AFAIK, <code>must</code> would be like 'AND' and <code>should</code> like 'OR'. What am I missing?</p>