Giter VIP home page Giter VIP logo

Comments (4)

ChristerGustavsson avatar ChristerGustavsson commented on May 26, 2024 1

That line you linked to pushed the correct value to the toUpsert array, sure. Which is used with toUpsert[0].refresh - so yeah that looks fine. But, like I've tried to explain a few times now it looks like it uses the wrong key when passed along to es.bulk:

Screenshot 2021-05-03 at 12 17 10

from dynamodb-stream-elasticsearch.

matrus2 avatar matrus2 commented on May 26, 2024

Hi @ChristerGustavsson,

You can notice that few lines above there is:
toUpsert.push({ index, id, body, refresh })
so the flag is set correctly. If you run tests you will find that:

  elasticsearch Starting a new request {
  method: 'POST',
  path: '/_bulk',
  bulkBody: [ { delete: [Object] } ],
  querystring: 'refresh=false',
  body: '{"delete":{"_index":"test","_id":"russ-wintheiser-c240e6ac-3"}}\n',
  headers: {
    'user-agent': 'elasticsearch-js/7.7.1 (darwin 20.2.0-x64; Node.js v14.15.3)',
    'content-type': 'application/x-ndjson',
    'content-length': '64'
  },
  timeout: 30000
} +154ms

Closing.

from dynamodb-stream-elasticsearch.

ChristerGustavsson avatar ChristerGustavsson commented on May 26, 2024

That test you did seems to be for delete not upserts, and that looks fine and uses the correct key for es.bulk:

const { body: bulkResponse } = await es.bulk({ refresh: toRemove[0].refresh, body: bodyDelete })

But if you look for upsert es.bulk:

const { body: bulkResponse } = await es.bulk({ toUpsert: toUpsert[0].refresh, body: updateBody })

from dynamodb-stream-elasticsearch.

matrus2 avatar matrus2 commented on May 26, 2024

Right, I put a wrong test example. Looking a code bulk uses correct value for refresh:
https://github.com/matrus2/dynamodb-stream-elasticsearch/blob/master/src/index.js#L62

from dynamodb-stream-elasticsearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.