Speculative deletes


(Nik Everett) #1

I'm in the position where I need to make sure a document is deleted from
the index when something occurs in my source system. I want to just hit it
with a DELETE every time. Is that a good idea?

It looks to me like DELETEing documents via ID is pretty cheap if the
document doesn't exist. It looks like it sets some dirty flags but is
otherwise pretty quick. My alternative is to do a GET and DELETE if it
exists or, maybe, do something cute like:
curl -XPOST 'localhost:9200/index/type/id/_update' -d '{
"script" : "ctx.op = "delete""
}'
which will short circuit that.

Thoughts?

Nik

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3sit9WTgMV6qPb3WojV8-8aQt7VtwOHV6aP8q%2BMx32UQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(Itamar Syn-Hershko) #2

I'm pretty sure you're right
On Jun 6, 2014 8:03 PM, "Nikolas Everett" nik9000@gmail.com wrote:

I'm in the position where I need to make sure a document is deleted from
the index when something occurs in my source system. I want to just hit it
with a DELETE every time. Is that a good idea?

It looks to me like DELETEing documents via ID is pretty cheap if the
document doesn't exist. It looks like it sets some dirty flags but is
otherwise pretty quick. My alternative is to do a GET and DELETE if it
exists or, maybe, do something cute like:
curl -XPOST 'localhost:9200/index/type/id/_update' -d '{
"script" : "ctx.op = "delete""
}'
which will short circuit that.

Thoughts?

Nik

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3sit9WTgMV6qPb3WojV8-8aQt7VtwOHV6aP8q%2BMx32UQ%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3sit9WTgMV6qPb3WojV8-8aQt7VtwOHV6aP8q%2BMx32UQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZtWFDs7vxvS1r4QEBLgr44wPLVUawW%2BO_63KSC_tOjZfw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(system) #3