Upsert with source disabled

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

--First create the mapping
curl -XPUT '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)

--

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 :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 6 janv. 2013 à 01:24, 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' -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)

--