You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kibble.apache.org by hu...@apache.org on 2017/10/23 21:39:16 UTC

[kibble-scanners] branch master updated: upsert isn't working

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kibble-scanners.git


The following commit(s) were added to refs/heads/master by this push:
     new 91a7fd7  upsert isn't working
91a7fd7 is described below

commit 91a7fd7bc7d029aee14e00d857256d9ee7014dd2
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Mon Oct 23 23:39:08 2017 +0200

    upsert isn't working
    
    gotta set the optype instead for bulks
---
 src/plugins/brokers/kibbleES.py | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/plugins/brokers/kibbleES.py b/src/plugins/brokers/kibbleES.py
index 272f61d..b834e04 100644
--- a/src/plugins/brokers/kibbleES.py
+++ b/src/plugins/brokers/kibbleES.py
@@ -100,14 +100,9 @@ class KibbleBit:
         for entry in xjson:
             js = entry
             doc = js
-            if js.get('upsert'):
-                doc = {
-                    'doc_as_upsert': True,
-                    'doc': js
-                }
             js['@version'] = 1
             js_arr.append({
-                '_op_type': 'index',
+                '_op_type': 'update' if js.get('upsert') else 'index',
                 '_consistency': 'quorum',
                 '_index': self.broker.config['elasticsearch']['database'],
                 '_type': js['doctype'],

-- 
To stop receiving notification emails like this one, please contact
['"commits@kibble.apache.org" <co...@kibble.apache.org>'].