Giter VIP home page Giter VIP logo

Comments (7)

pulkitsinghal avatar pulkitsinghal commented on August 12, 2024 1

@juanpujol - I like what you have and I do think it would have made a valid PR, even if there may have been a little bit of back & forth.

Right now I'm trying to use https://github.com/arielfr/elastic-deletebyquery to make it work, a bit stuck but let's hope I figure it out as it would be a more complete solution. Also am worried about blocking code but lets see.

from loopback-connector-elastic-search.

pulkitsinghal avatar pulkitsinghal commented on August 12, 2024

This is a valid bug, I verified by running tests against v2.x, thanks to @harshadyeola for setting up easy to use docker instructions

Ah, dang! Its deprecated in 1.5.3 according to docs

screen shot 2016-08-06 at 12 48 49 am

from loopback-connector-elastic-search.

pulkitsinghal avatar pulkitsinghal commented on August 12, 2024
  1. Latest stable version of ES is 2.3.4 as of now and that may be made to work according to this comment:

    delete-by-query has been implemented using bulk, and moved into a plugin

    1. If we want to use the plugin approach, then the users with ES need to use the following for v2.3 etc: https://github.com/elastic/elasticsearch/tree/2.3/plugins/delete-by-query
      1. From the connector code persepective, we need to update the connector to use https://github.com/dermidgen/elasticsearch-deletebyquery

        which is a:

        Elasticsearch-js client extension for the Delete-by-query plugin

    2. If we want to use the scroll/scan approach, someone was nice enough to share that too! https://github.com/arielfr/elastic-deletebyquery
  2. But I think the master version of ES tells a different story for the future completely:

    The Delete-By-Query plugin has been removed in favor of a new Delete By Query API implementation in core. It now supports throttling, retries and cancellation but no longer supports timeouts. Instead use the cancel API to cancel deletes that run too long.

    1. elastic/elasticsearch#18516

    2. elastic/elasticsearch-migration#61

    3. And its back again in reference/master docs! Huh?
      screen shot 2016-08-06 at 1 19 57 am

    4. Old(1.5.3) versus SuperNew(master/5.x)

      #old
      DELETE twitter/tweet/_query
      {
          "query" : {
              "term" : { "user" : "kimchy" }
          }
      }
      
      #super new
      POST twitter/_delete_by_query
      {
        "query": { 
          "match": {
            "message": "some message"
          }
        }
      }
      

from loopback-connector-elastic-search.

juanpujol avatar juanpujol commented on August 12, 2024

I added a conditional to the destroyAll method so it will work with the native delete using just id from ElasticSearch v2.x.

https://gist.github.com/juanpujol/3a3ad4aa8a60b649f632127bd5814d2f#file-esconnector_destroyall-js-L27

It should work as long the apiVersion setting is set to 2.x.

This works for me but I don't know if should go on a PR.

from loopback-connector-elastic-search.

pulkitsinghal avatar pulkitsinghal commented on August 12, 2024

BTW, it only seems appropriate that I thank both:

  1. @arielfr for https://github.com/arielfr/elastic-deletebyquery,
  2. and @dermidgen https://github.com/dermidgen/elasticsearch-deletebyquery

for their separate and novel approach ... without them my research into a possible resolution would not get as far.

from loopback-connector-elastic-search.

pulkitsinghal avatar pulkitsinghal commented on August 12, 2024

@juanpujol - it is done and released in 1.0.7 of this connector, please take it for a spin and reopen this issue if it is not fixed.

Out of the many approaches, I chose to use https://github.com/arielfr/elastic-deletebyquery to make it work which means that scam/scrol is used in tandem with bulk queries to ES v2.x

from loopback-connector-elastic-search.

juanpujol avatar juanpujol commented on August 12, 2024

@pulkitsinghal sorry it took me so long. I tested and it works, thank you!

from loopback-connector-elastic-search.

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.