# Problem re-adding the same fields to start with a lowercase letter when updating

**URL:** <https://discuss.elastic.co/t/problem-re-adding-the-same-fields-to-start-with-a-lowercase-letter-when-updating/290015>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [November 24, 2021, 6:45am UTC](https://discuss.elastic.co/t/problem-re-adding-the-same-fields-to-start-with-a-lowercase-letter-when-updating/290015 "2021-11-24T06:45:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Busra\_Duygu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/busra_duygu/32/90462_2.png) [@Busra\_Duygu](https://discuss.elastic.co/u/Busra_Duygu)\
**Post date:** [November 24, 2021, 6:45am UTC](https://discuss.elastic.co/t/problem-re-adding-the-same-fields-to-start-with-a-lowercase-letter-when-updating/290015/1 "2021-11-24T06:45:43Z")

</div>

Hello dear friends. I am encountering a problem while updating. The problem I'm having is, for example, I want to update the Title field, but I see that a new field has been created for the Title field in the document. (A title field that starts with a lowercase letter). I'm doing the update process with NEST, can anyone share an idea with me? Thank you in advance for your help 🙂

**The state of the document before the update:**

```auto
      {
        "_index" : "my_test_index",
        "_type" : "_doc",
        "_id" : "uPggFnoBChFNLIc8qdjW",
        "_score" : 31.908756,
        "_source" : {
          "RelatedPassiveCompanyId" : "0d075c1681106286cfe9f31999f8247c",
          "CreateTime" : "2021-06-16T21:41:17.2697847+03:00",
          "Title" : "FE NEW CENTURY INDUSTRY(SINGAPORE)PTE LTD",
          "IsBannedFromOpenCorpCompanies" : false,
          "CreatedBy" : 1,
          "IsActivated" : false,
          "IsCancelled" : false,
          "IsMembershipTypeBought" : false
        }
      }

```

**The state of the document after the update:**

```auto
      {
        "_index" : "my_test_index",
        "_type" : "_doc",
        "_id" : "uPggFnoBChFNLIc8qdjW",
        "_score" : 26.380388,
        "_source" : {
          "RelatedPassiveCompanyId" : "0d075c1681106286cfe9f31999f8247c",
          "CreateTime" : "2021-06-16T21:41:17.2697847+03:00",
          "Title" : "FE NEW CENTURY INDUSTRY(SINGAPORE)PTE LTD",
          "IsBannedFromOpenCorpCompanies" : false,
          "CreatedBy" : 1,
          "IsActivated" : false,
          "IsCancelled" : false,
          "IsMembershipTypeBought" : false,
          "isBannedFromOpenCorpCompanies" : false,
          "contactInformations" : {
            "contactPerson" : { },
            "phones" : []
          },
          "isCancelled" : false,
          "dnbInformation" : {
            "processId" : "fba921ee-493d-4f12-aa0a-0a432b9e8b3a",
            "requestLogs" : [
              {
                "requestTime" : "2021-11-23T10:03:09.8302661+03:00",
                "message" : "Company not found on Dnb",
                "resultType" : 2
              }
            ]
          },
          "createTime" : "2021-06-16T21:41:17.2697847+03:00",
          "createdBy" : 1,
          "isMembershipTypeBought" : false,
          "isActivated" : false,
          "title" : "FE NEW CENTURY INDUSTRY(SINGAPORE)PTE LTD",
          "relatedPassiveCompanyId" : "0d075c1681106286cfe9f31999f8247c"
        }
      },

```

**my update function:**

```auto

public bool UpdateDocuments(IHit<MyESModel> documentHitItem)
        {
            var response = elasticClient.Update<MyESModel, object>(DocumentPath<MyESModel>
                .Id(documentHitItem.Id), u => u
                .Index("my_test_index")
                .Doc(documentHitItem.Source)
                .DocAsUpsert(true)
                .RetryOnConflict(8)
            );
            return response.IsValid;
        }

```

I would be very happy if anyone has any idea what the problem could be.

---

<div class="post-metadata">

**Author:** ![stevejgordon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stevejgordon/32/80912_2.png) [@stevejgordon](https://discuss.elastic.co/u/stevejgordon)\
**Post date:** [November 24, 2021, 7:21am UTC](https://discuss.elastic.co/t/problem-re-adding-the-same-fields-to-start-with-a-lowercase-letter-when-updating/290015/2 "2021-11-24T07:21:35Z")

</div>

Hi Büşra,

By default, NEST assumes field names should be camelCase as is common for JSON documents. You may [reconfigure the default](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/field-inference.html#camel-casing) behaviour such that field names match the PascalCase of the original property name. In your case, you need to pass the function as...

```auto
DefaultFieldNameInferrer(p => p);

```

Steve

---

<div class="post-metadata">

**Author:** ![Busra\_Duygu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/busra_duygu/32/90462_2.png) [@Busra\_Duygu](https://discuss.elastic.co/u/Busra_Duygu)\
**Post date:** [November 24, 2021, 10:01am UTC](https://discuss.elastic.co/t/problem-re-adding-the-same-fields-to-start-with-a-lowercase-letter-when-updating/290015/3 "2021-11-24T10:01:44Z")

</div>

Firstly thank you for giving, but I don't quite understand how to use it. I mean, do I need to use it in the mapping part while creating the index or is it in the update function?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 22, 2021, 10:01am UTC](https://discuss.elastic.co/t/problem-re-adding-the-same-fields-to-start-with-a-lowercase-letter-when-updating/290015/4 "2021-12-22T10:01:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
