title: Convert KQL to C# Object Syntax Initializer
body: <p>I have this query which want to convert to C# nest query which have term filter and script clause for updating the query the query is working perfectly in Kibana Dev Tools but could not convert in nest C# object initializer syntax.</p>
  <pre><code>POST acquiringdata/_update_by_query
  {
    &quot;script&quot;: {
      &quot;inline&quot;: &quot;ctx._source.Address = 'FORTRESS STADIUM GROUND FLOOR OPPOSITE_TestasadasD2'&quot;,
      &quot;lang&quot;: &quot;painless&quot;
    },
    &quot;query&quot;: {
      &quot;bool&quot;: {
        &quot;must&quot;: [
          {
            &quot;term&quot;: {
              &quot;PaymentTransactionID&quot;: {
                &quot;value&quot;: &quot;58804121&quot;
              }
            }
          }
        ]
      }
    }
  }
  </code></pre>
  <p>So far came for conclusion to this code</p>
  <pre><code>var filterClause = new List&lt;QueryContainer&gt;();
  //  var ScriptClause = new List&lt;ScriptQueryContainer&gt;();
  filterClause.Add(new TermQuery
          {
              Field = new Field(&quot;PaymentTransactionID&quot;),
              Value = transaction.PaymentTransactionID,
          });
  
  string _templateString = &quot;ctx._source.Address = 'FORTRESS STADIUM GROUND FLOOR OPPOSITE_TestasadasD2'&quot;;
  
  // ScriptClause.Add(new ScriptQuery{
  //    Name = &quot;named_query&quot;,
  //    Boost = 1.1,
  //    Script = new InlineScript(_templateString)
  //    {
  //        Params = new Dictionary&lt;string, object&gt; {
  //      { &quot;ctx._source.Address&quot;, &quot;123&quot; }
  //        }
  //    }
  //});
  
  var SearchRequest = new SearchRequest&lt;NewIndexClass&gt;(NewTestingIndex)
          {
              Size = 1000,
              Query = new BoolQuery
              {
                  Must = filterClause,
              }
          };
  
  var searchResponse = _elasticClient.Search&lt;NewIndexClass&gt;(SearchRequest);
  
  if (searchResponse.ApiCall.ResponseBodyInBytes != null)
  {
      var requestJson = System.Text.Encoding.UTF8.GetString(searchResponse.ApiCall.RequestBodyInBytes);
      var JsonFormatQuery = JsonConvert.SerializeObject(JsonConvert.DeserializeObject(requestJson), Formatting.Indented);
  }
  </code></pre>
  <p>I can achieve this output without script query.</p>
  <pre><code>GET _search
  {
    &quot;query&quot;: {
      &quot;bool&quot;: {
        &quot;must&quot;: [
          {
            &quot;term&quot;: {
              &quot;PaymentTransactionID&quot;: {
                &quot;value&quot;: &quot;58804121&quot;
              }
            }
          }
        ]
      }
    },
    &quot;size&quot;: 1000
  }
  </code></pre>
  <p>Any help would be appreciated to convert this into script query.</p>