title: Elasticsearch query to filter documents where value1 == value2 with Go olivere/elastic
body: <p>I need to build query to get documents where doc.value1 == doc.value2</p>
  
  <pre><code>{
      "query": {
          "bool" : {
              "filter" : [{
                  "script" : {
                      "script" : {
                          "source": "doc['val1'].value == doc['val2'].value",
                          "lang": "painless"
                       }
                  }
              }]
          }
      }
  }
  </code></pre>
  
  <p>This what I need to build with olivere/elastic, it work if I send it as POST request.</p>
  
  <p>In golang I have something like</p>
  
  <pre class="lang-golang prettyprint-override"><code>"github.com/olivere/elastic"
  ...
  
  query := elastic.NewBoolQuery()
  // then add something to this query or leave it empty it works fine
  // but if I add 
  query = query.Filter(elastic.NewBoolQuery().Must(elastic.NewScript("doc.['val1'].value == doc.['val2'].value")))
  // I'm getting: Error 400 (Bad Request): [source] query malformed,
  // no start_object after query name [type=parsing_exception]
  
  // Then i run it like:
  client, err := elastic.NewClient()
  if err != nil {
      fmt.Println(err)
      return
  }
  resp, err := client.Search("myIndex").Type("myDoc").Query(query).TrackTotalHits(true).Size(limit).Do(context.Background())
      if err != nil {
          fmt.Println(err)
          return
      }
  </code></pre>