# Elastic search default values for a field

**URL:** <https://discuss.elastic.co/t/elastic-search-default-values-for-a-field/81406>\
**Category:** Elasticsearch\
**Created:** [April 6, 2017, 4:37am UTC](https://discuss.elastic.co/t/elastic-search-default-values-for-a-field/81406 "2017-04-06T04:37:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shushant\_Arora](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Shushant\_Arora](https://discuss.elastic.co/u/Shushant_Arora)\
**Post date:** [April 6, 2017, 4:37am UTC](https://discuss.elastic.co/t/elastic-search-default-values-for-a-field/81406/1 "2017-04-06T04:37:25Z")

</div>

Hi

Is it possible to assign default values for a field , when a document does not have that field treat it as default assigned and process.

This is different from null\_value where we need to explicitly set null for a field so that replaced value should be taken ?, Is it possible without explicit setting null ?

---

<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:** [April 6, 2017, 7:32am UTC](https://discuss.elastic.co/t/elastic-search-default-values-for-a-field/81406/2 "2017-04-06T07:32:06Z")

</div>

Hey,

setting something like a default value needs to be done before a document is indexed. You might want to use a pipeline for that or enrich the document in your application.

--Alex

---

<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:** [May 4, 2017, 7:32am UTC](https://discuss.elastic.co/t/elastic-search-default-values-for-a-field/81406/3 "2017-05-04T07:32:12Z")

</div>

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