# Enabling null values on expanded document in Kibana Discover

**URL:** https://discuss.elastic.co/t/enabling-null-values-on-expanded-document-in-kibana-discover/341052
**Category:** Kibana
**Created:** [August 17, 2023, 7:43pm UTC](https://discuss.elastic.co/t/enabling-null-values-on-expanded-document-in-kibana-discover/341052 "2023-08-17T19:43:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![PodarcisMuralis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/podarcismuralis/32/122606_2.png) [@PodarcisMuralis](https://discuss.elastic.co/u/PodarcisMuralis)
#### Post date: [August 17, 2023, 7:43pm UTC](https://discuss.elastic.co/t/enabling-null-values-on-expanded-document-in-kibana-discover/341052/1 "2023-08-17T19:43:17Z")

</div>

Hi.

I am using version 8.5.3.

- I created a Data View under Stack Management.
- Displayed an index with multiple fields successfully
- If we filter results and click the diagonal button on document, expanded document comes in from the rights as slide in.
- It displays the document in detail.

But when my custom\_field has value "null" it does not display my field custom\_field even in json section.

Is there any way to display custom\_field?

Thanks.

---

<div class="post-metadata">

### Author: ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)
#### Post date: [September 5, 2023, 10:54am UTC](https://discuss.elastic.co/t/enabling-null-values-on-expanded-document-in-kibana-discover/341052/2 "2023-09-05T10:54:40Z")

</div>

The noSQL nature of the Elasticsearch database involves dynamic mapping, so a document with a field with a `null` value is not indexed.

From the `null_value` property documentation:

> A `null` value cannot be indexed or searched. When a field is set to `null`, (or an empty array or an array of `null` values) it is treated as though that field has no values.

> **[null\_value | Elasticsearch Guide \[8.9\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/null-value.html)**

You may want to leverage that parameter to explicitly mark null values but not [all field types](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/mapping-types.html) support it.

Here some testing to play with:

```auto
# Clean up
DELETE discuss-341052

# Create an index with some null values
PUT discuss-341052
{
  "settings": {
    "number_of_replicas": 0
  },
  "mappings": {
    "properties": {
      "title": { "type": "text"},
      "category": { "type": "keyword", "null_value": "NULL"},
      "description": { "type": "text"},
      "score": { "type": "float", "null_value": -1}
    }
  }
}

# Add some data with some rows without fields, 
# others with explicit null values
POST discuss-341052/_bulk
{ "index": {} }
{ "title": "a", "category": "a", "description": "a desc", "score": 1}
{ "index": {} }
{ "title": "b", "category": "a", "description": "a desc", "score": 1}
{ "index": {} }
{ "title": "c", "category": "b", "description": "a desc", "score": 1}
{ "index": {} }
{ "title": "c", "category": "b"}
{ "index": {} }
{ "title": "c", "category": "c", "description": null, "score": -1}
{ "index": {} }
{ "title": "d", "category": "NULL", "description": "a desc", "score": -1}

# Create a Kibana Data View
POST kbn:/api/data_views/data_view
{
  "data_view": {
    "title": "discuss-341052"
  }
}

```

So on Discover some documents don't have the missing fields as you mentioned

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/5/b5da284fa741e68a315f96288186e12a70c9e64d.png)

But the last document has the explicit (and searchable) null documents

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/6/1650b07449ebe2c0241d50cfd505e9703e990242.png)

---

<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: [October 3, 2023, 10:55am UTC](https://discuss.elastic.co/t/enabling-null-values-on-expanded-document-in-kibana-discover/341052/3 "2023-10-03T10:55:28Z")

</div>

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