When I index some documents and they are not refreshed yet, can I deleted them?


(Makeyang) #1

let's say I bulk insert some documents and then I want to delete them, can ES handle it properly? if so, how?


(Mark Walkom) #2

Yes it can.
The easiest way to understand would be to read this chapter - https://www.elastic.co/guide/en/elasticsearch/guide/master/inside-a-shard.html


(Christian Dahlqvist) #3

If you have explicitly assigned IDs to the documents at the client prior to indexing them you can delete them using this before a refresh takes place and they are made searchable. If you however rely on Elasticsearch assigning the document IDs, you may need to wait until you can identify the documents through a query unless you are keeping track of the IDs being returned in the bulk request response.


(Makeyang) #4

so if I have id, I can delete it, if not, I can't. right?


(Christian Dahlqvist) #5

I believe so but have not tested it. What is your use case?


(Makeyang) #6

no use case right now. I'll do some test later. thank u


(system) #7