0

I couldn't see any documentation/example about using delete by query api with bulk api in elastic search.

Simply, I want to delete all the documents having same A field and insert many documents just after that. If delete process fails, it shouldn't insert any documents.

e.g.

POST _bulk
{ "index" : { "_index" : "test", "_type" : "type1", "_id" : "1" } }
{ "field1" : "value1" }
??? { "delete_by_query???" : { "_index" : "test", "_type" : "type1", "query"... } }

Is there any way to use them together? Thanks.

skynyrd
  • 942
  • 4
  • 14
  • 34
  • 2
    This is not supported by the bulk endpoint, it's easier to handle that in your application logic. (note that in your sample you do exactly the opposite as you described) – Val Aug 09 '17 at 07:58
  • 1
    The main reason being that delete-by-query can be a very long process, in contrary to index/update/delete operations – Val Aug 09 '17 at 08:01
  • Ok then, I'm going to handle that in api. Thanks – skynyrd Aug 09 '17 at 08:16

0 Answers0