title: Elasticsearch with nested AND/OR query
body: <p>I'm struggling with writing an elastic search query with multiple AND/OR conditions.</p>
  
  <p>It basically comes to the following logic:
  <code>cond1 &amp;&amp; (cond2 || cond3 || cond4)</code></p>
  
  <p>As mentioned in the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/6.3/query-dsl-bool-query.html" rel="nofollow noreferrer">docs</a>, a document is considered a match if it satisfies only the must clause. The should clauses in this case act as a boost i.e. if a document matches one or more of the should clauses in addition to the must clause, then it will have a higher relevancy score, assuming that cond2, cond3 and cond4 are queries that calculate a relevancy score.</p>
  
  <p>The problem is that I only want documents that also match at least one of the OR conditions. </p>
  
  <p>Note that I'm running ES6.3. I've also tried <a href="https://www.elastic.co/guide/en/elasticsearch/guide/current/match-multi-word.html" rel="nofollow noreferrer">Multiword queries</a> but these results are also wrong.</p>
  
  <p>Adding <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-boost.html" rel="nofollow noreferrer">boost</a> doesn't seem to affect the results, I have results that only match the first condition. </p>
  
  <pre><code>{
      "query": {
          "bool": {
              "must": [
                {
                      "term": {
                          "event.keyword": {
                              "value": "webhook.trigger"
                          }
                      }
                  }
              ],
              "should": [
                  {
                      "match": {
                          "metaData.webhook.title": "My Example Title 1"
                      }
                  },
                  {
                      "match": {
                          "metaData.webhook.title": "Testing"
                      }
                  },
  {
                      "match": {
                          "metaData.webhook.url": "myurl.com"
                      }
                  }
              ]
          }
      }
  }
  </code></pre>