# Null value in field type with nested

**URL:** <https://discuss.elastic.co/t/null-value-in-field-type-with-nested/341278>\
**Category:** Elasticsearch\
**Created:** [August 21, 2023, 4:18pm UTC](https://discuss.elastic.co/t/null-value-in-field-type-with-nested/341278 "2023-08-21T16:18:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Murilo\_Livorato](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/murilo_livorato/32/123848_2.png) [@Murilo\_Livorato](https://discuss.elastic.co/u/Murilo_Livorato)\
**Post date:** [August 21, 2023, 4:18pm UTC](https://discuss.elastic.co/t/null-value-in-field-type-with-nested/341278/1 "2023-08-21T16:18:24Z")

</div>

I have a filed , that if has value , it has ID and TITLE .  
so , wold be like this -

```auto

category: { id: 2, title: 'monitor' }

```

but can be like this as well

```auto
category: NULL

```

So I did like this the mapping -

```auto
  "category":{
             "properties": {
              "id": { "type": "integer" },
              "title": { "type": "keyword" }
            },
             "null_value": "NULL" 
         },

```

but it seams that I can set null\_value there -

```auto
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "Mapping definition for [type] has unsupported parameters: [null_value : NULL]"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "Failed to parse mapping: Mapping definition for [type] has unsupported parameters: [null_value : NULL]",
    "caused_by": {
      "type": "mapper_parsing_exception",
      "reason": "Mapping definition for [type] has unsupported parameters: [null_value : NULL]"
    }
  },

```

What wold be the best way to do it ?

---

<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:** [September 18, 2023, 4:19pm UTC](https://discuss.elastic.co/t/null-value-in-field-type-with-nested/341278/2 "2023-09-18T16:19:16Z")

</div>

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