title: How to update nested objects using Nest Elasticsearch?
body: <p>I have product index which for simplicity has two fields Id and ProductAttributes as nested object defined as following:</p>
  
  <pre><code>public class ProductType
  {
      public Guid Id { get; set; }
  
      public List&lt;ProductAttribute&gt; ProductAttributes { get; set; }
   }
  
  public class ProductAttribute
  {
      public Guid Id { get; set; }
  
      public string Name { get; set; }
  
      public string Value { get; set; }
  }
  </code></pre>
  
  <p>And the following mapping:</p>
  
  <pre><code>elasticClient.CreateIndex("product", i =&gt; i
         .Settings(s =&gt; s
                   .NumberOfShards(2)
                   .NumberOfReplicas(0)
                   )
                   .Mappings(m =&gt; m
                     .Map&lt;ProductType&gt;(map =&gt; map
                           .AutoMap()
                           .Properties(p =&gt; p
                            .Nested&lt;ProductAttribute&gt;(n =&gt; n
                              .Name(c =&gt; c.ProductAttributes)
                              .AutoMap()
                              .Properties(nc =&gt; nc
                                 .Keyword(t =&gt; t
                                     .Name(nn =&gt; nn.Name)
                                     )
                                .Keyword(t =&gt; t
                                  .Name(nn =&gt; nn.Value)
                               )
                    )
               )
  </code></pre>
  
  <p>Now I am trying to update name field inside nested object and I have tried implementing that using scripted update as following:</p>
  
  <pre><code>        var scriptParams = new Dictionary&lt;string, object&gt;
                              {
                                  {"name", "new name"}
                              };
  
          var result = elasticClient.UpdateByQuery&lt;ProductType&gt;(u =&gt; u
                                .Script(sn =&gt; sn
                                     .Inline(
                                            $"ctx._source.productAttributes= params.name;" 
                                        )
                                    .Params(scriptParams)
                                )
                                .Conflicts(Conflicts.Proceed)
                                .Refresh(true)
                            );
  </code></pre>
  
  <p>But using the above query I couldn't update the nested object, could you please tell how can I update nested object using <strong>_update_by_query</strong> api using nest ES?</p>