# Null\_value for old values

**URL:** <https://discuss.elastic.co/t/null-value-for-old-values/7787>\
**Category:** Elasticsearch\
**Created:** [May 21, 2012, 3:24pm UTC](https://discuss.elastic.co/t/null-value-for-old-values/7787 "2012-05-21T15:24:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yehuda\_Zargarov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yehuda_zargarov/32/2164_2.png) [@Yehuda\_Zargarov](https://discuss.elastic.co/u/Yehuda_Zargarov)\
**Post date:** [May 21, 2012, 3:24pm UTC](https://discuss.elastic.co/t/null-value-for-old-values/7787/1 "2012-05-21T15:24:03Z")

</div>

Hi,

I've extended an existing schema with a new field.  
I added "null\_value":-1 to the mapping.

Should I be able to search for old data with the null value (with -1)? or  
does it only applies to new data?

Thanks,

Yehuda

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 23, 2012, 9:36pm UTC](https://discuss.elastic.co/t/null-value-for-old-values/7787/2 "2012-05-23T21:36:27Z")

</div>

It only applies to new data, though note that null\_value only applied when  
a json null is provided. If there isn't a null\_value, you can use missing  
filter, which will also match on old data (since old data doesn't have hte  
field).

On Mon, May 21, 2012 at 5:24 PM, Yehuda Zargarov [yz1583@gmail.com](mailto:yz1583@gmail.com) wrote:

> Hi,
> 
> I've extended an existing schema with a new field.  
> I added "null\_value":-1 to the mapping.
> 
> Should I be able to search for old data with the null value (with -1)? or  
> does it only applies to new data?
> 
> Thanks,
> 
> Yehuda

---

<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:** [July 6, 2017, 3:27am UTC](https://discuss.elastic.co/t/null-value-for-old-values/7787/3 "2017-07-06T03:27:28Z")

</div>

Closed on July 6, 2017, 3:27am UTC


