Re: Bulk - insert if not exists, update otherwise?

2014-08-11 Thread eunever32
I think you're on the right track. If you just run again you should get the update. Does the document appear correct? Note new option in 1.4 scripted_upsert true Allows the document to be sent once for efficiency. -- You received this message because you are subscribed to the Google Groups

Re: Bulk - insert if not exists, update otherwise?

2014-08-11 Thread Christopher Ambler
Okay, so now here's where I am - I read up on upsert and crafted my bulk stack. It seems to work: {"update":{"_index":"aftermarket-2014-08-11_02-38-19","_type":"premium","_id":"kryptonblue.com"}} {"script" : "ctx._source.auctionid=6623102; ctx._source.auctiontype=18; ctx._source.auctionstatus=4;

Re: Bulk - insert if not exists, update otherwise?

2014-08-11 Thread eunever32
I see what you mean about MVEL I guess the same functionality is available in the replacement. Groovy. I will need to investigate switching to Groovy. -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop

Re: Bulk - insert if not exists, update otherwise?

2014-08-11 Thread Christopher Ambler
Wait, hang on - I just saw this in the docs. Are you suggesting a solution that's being deprecated? If so, that's likely not a good idea. I'm now confused ;) [image: Warning] Deprecated in 1.3.0. Mvel has been deprecated and will be removed in 1.4.0. -- You received this message because you a

Re: Bulk - insert if not exists, update otherwise?

2014-08-11 Thread Christopher Ambler
Excellent - are there any examples I can see? Where can I read and learn how to do this? On Monday, August 11, 2014 10:19:51 AM UTC-7, eune...@gmail.com wrote: > > What you're describing is the upsert functionality in the mvel scripting. > > The upsert will create and populate when the key does

Bulk - insert if not exists, update otherwise?

2014-08-11 Thread eunever32
What you're describing is the upsert functionality in the mvel scripting. The upsert will create and populate when the key doesn't exist. And the update api will add to the document if it does already exist. -- You received this message because you are subscribed to the Google Groups "el

Bulk - insert if not exists, update otherwise?

2014-08-11 Thread Christopher Ambler
I have a situation where I have code that does 3000 bulk inserts of data. This works just fine. What I now need to do is 3000 bulk inserts OR updates. Specifically, if the key already exists, I need to UPDATE fields A, B and C. If the key does NOT exists, I need to INSERT all fields. But again,