title: How do I have to write a Search Query in ElasticSearch?
body: <p>I use the Grails ElasticSearch Plugin and want to use the following query: </p>
  
  <pre><code>"bool" : {
      "must" : {
          "term" : { "user" : "kimchy" }
      },
      "must_not" : {
          "range" : {
              "age" : { "from" : 10, "to" : 20 }
          }
      },
      "should" : [
          {
              "term" : { "tag" : "wow" }
          },
          {
              "term" : { "tag" : "elasticsearch" }
          }
      ],
      "minimum_should_match" : 1,
      "boost" : 1.0
  }
  </code></pre>
  
  <p>Using the groovy api from the Grails plugin I would write something like: </p>
  
  <pre><code>def res = userAgentIdentService.search() {
      "bool" {
          "must" {
              term("user" : "kimchy" )
          }
          "must_not"  {
              "range"  {
                  age("from" : 10, "to" : 20 }
              }
          }
          "should" : [
              {
                  term( "tag" : "wow" )
              }
              {
                  term("tag" : "elasticsearch" )
              }
          ]
          "minimum_should_match" = 1
          "boost" = 1.0
      } 
  
  }
  </code></pre>
  
  <p>My query is not working! </p>
  
  <ol>
  <li><p>Where do I have to define minimum_should_match and how do I have to define it?</p></li>
  <li><p>How do I have to write the "should" : [ ... ] square brackets notation in the grails / groovy manner?</p></li>
  </ol>