# Null\_value in mapping for individual components of date\_range

**URL:** <https://discuss.elastic.co/t/null-value-in-mapping-for-individual-components-of-date-range/215632>\
**Category:** Elasticsearch\
**Created:** [January 19, 2020, 5:06pm UTC](https://discuss.elastic.co/t/null-value-in-mapping-for-individual-components-of-date-range/215632 "2020-01-19T17:06:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dougbergh](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@dougbergh](https://discuss.elastic.co/u/dougbergh)\
**Post date:** [January 19, 2020, 5:06pm UTC](https://discuss.elastic.co/t/null-value-in-mapping-for-individual-components-of-date-range/215632/1 "2020-01-19T17:06:28Z")

</div>

Mapping below.

Docs need to be able to have non-null start date and null end date.

How do I specify null\_value for each date in date\_range individually?

```
    {
  "de-mr-j-2019.06" : {
    "mappings" : {
      "date_detection" : false,
      "numeric_detection" : false,
      "properties" : {
        "@effective_time" : {
        "type" : "date",
        "null_value" : "1970-01-01T00:00:00+00:00"
        },
        "@effective_time_end" : {
          "type" : "date",
          "null_value" : "1970-01-01T00:00:00+00:00"
        },
        "@effective_time_range" : {
          "type" : "date_range"
        },
```

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 21, 2020, 12:54pm UTC](https://discuss.elastic.co/t/null-value-in-mapping-for-individual-components-of-date-range/215632/2 "2020-01-21T12:54:11Z")

</div>

hey,

how about using an ingest processor of adding a date range field, if it is not part of the JSON? This way you don't need to use the null\_value mapping.

--Alex

---

<div class="post-metadata">

**Author:** ![dougbergh](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@dougbergh](https://discuss.elastic.co/u/dougbergh)\
**Post date:** [January 24, 2020, 8:38pm UTC](https://discuss.elastic.co/t/null-value-in-mapping-for-individual-components-of-date-range/215632/3 "2020-01-24T20:38:30Z")

</div>

Alex, a good thought, i'll give it a try. Thanks!!

---

<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:** [February 21, 2020, 8:38pm UTC](https://discuss.elastic.co/t/null-value-in-mapping-for-individual-components-of-date-range/215632/4 "2020-02-21T20:38:39Z")

</div>

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