# Upsert with source disabled

**URL:** <https://discuss.elastic.co/t/upsert-with-source-disabled/10235>\
**Category:** Elasticsearch\
**Created:** [January 6, 2013, 12:24am UTC](https://discuss.elastic.co/t/upsert-with-source-disabled/10235 "2013-01-06T00:24:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![avin](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@avin](https://discuss.elastic.co/u/avin)\
**Post date:** [January 6, 2013, 12:24am UTC](https://discuss.elastic.co/t/upsert-with-source-disabled/10235/1 "2013-01-06T00:24:05Z")

</div>

Can I "upsert" an index dynamically with the source disabled ?

--First create the mapping  
curl -XPUT '[http://localhost:9200/indexName/indexType/\_mapping](http://localhost:9200/indexName/indexType/_mapping)' -d  
'{"indexType":{"\_source":{"enabled":false}}}'

And then here is what I am trying to do.

- Create an index (upsert) with an id
- Update (upset) with the same id

I get the following exception when I try:

Caused by: org.elasticsearch.index.engine.DocumentSourceMissingException:  
[indexName][1] [indexType][id]: document source missing

at org.elasticsearch.action.update.TransportUpdateAction.shardOperation(  
TransportUpdateAction.java:274)

at org.elasticsearch.action.update.TransportUpdateAction.shardOperation(  
TransportUpdateAction.java:210)

at org.elasticsearch.action.update.TransportUpdateAction.shardOperation(  
TransportUpdateAction.java:84)

at  
org.elasticsearch.action.support.single.instance.TransportInstanceSingleOperationAction$AsyncSingleAction$1.run(  
TransportInstanceSingleOperationAction.java:191)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(  
ThreadPoolExecutor.java:886)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(  
ThreadPoolExecutor.java:908)

at java.lang.Thread.run(Thread.java:680)

--

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 6, 2013, 7:30am UTC](https://discuss.elastic.co/t/upsert-with-source-disabled/10235/2 "2013-01-06T07:30:28Z")

</div>

You are trying to index an empty document? Why?  
"Source disabled" means that ES won't store the document you send but only index it.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 6 janv. 2013 à 01:24, [avinsemail@gmail.com](mailto:avinsemail@gmail.com) a écrit :

Can I "upsert" an index dynamically with the source disabled ?

--First create the mapping  
curl -XPUT '[http://localhost:9200/indexName/indexType/\_mapping](http://localhost:9200/indexName/indexType/_mapping)' -d '{"indexType":{"\_source":{"enabled":false}}}'

And then here is what I am trying to do.

- Create an index (upsert) with an id
- Update (upset) with the same id

I get the following exception when I try:

## Caused by: org.elasticsearch.index.engine.DocumentSourceMissingException: [indexName][1] [indexType][id]: document source missing at org.elasticsearch.action.update.TransportUpdateAction.shardOperation(TransportUpdateAction.java:274) at org.elasticsearch.action.update.TransportUpdateAction.shardOperation(TransportUpdateAction.java:210) at org.elasticsearch.action.update.TransportUpdateAction.shardOperation(TransportUpdateAction.java:84) at org.elasticsearch.action.support.single.instance.TransportInstanceSingleOperationAction$AsyncSingleAction$1.run(TransportInstanceSingleOperationAction.java:191) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680)

--

---

<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, 2:57am UTC](https://discuss.elastic.co/t/upsert-with-source-disabled/10235/3 "2017-07-06T02:57:44Z")

</div>


