Deleting first n documents from index

Hey, this is a pretty simple question but after much searching I'm still
stumped. Basically I want to create a delete by query that deletes the
first n documents from a given index. The only thing I found relating to
restricting the size were the from/size parameters
http://www.elasticsearch.org/guide/reference/api/search/from-size/ but as
far as I'm aware that isn't compatible with the query DSL. I also found the
limit query but that only limits the documents to retrieve per shard. I'm
probably missing something really obvious but I'm completely stumped.

Any help would be greatly appreciated, Thanks

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

a delete by query will delete all documents that match the query not just
the top N results. How do you define the first N? are they the oldest docs
in the index? maybe you can give some details so we can help better.

simon

On Wednesday, May 15, 2013 11:21:08 PM UTC+2, Jim Flim wrote:

Hey, this is a pretty simple question but after much searching I'm still
stumped. Basically I want to create a delete by query that deletes the
first n documents from a given index. The only thing I found relating to
restricting the size were the from/size parameters
http://www.elasticsearch.org/guide/reference/api/search/from-size/ but as
far as I'm aware that isn't compatible with the query DSL. I also found the
limit query but that only limits the documents to retrieve per shard.
I'm probably missing something really obvious but I'm completely stumped.

Any help would be greatly appreciated, Thanks

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Yea basically I want a query that matches all docs of an index and deletes
the oldest n documents
On May 15, 2013 5:24 PM, "simonw" simon.willnauer@elasticsearch.com wrote:

Hey,

a delete by query will delete all documents that match the query not just
the top N results. How do you define the first N? are they the oldest docs
in the index? maybe you can give some details so we can help better.

simon

On Wednesday, May 15, 2013 11:21:08 PM UTC+2, Jim Flim wrote:

Hey, this is a pretty simple question but after much searching I'm still
stumped. Basically I want to create a delete by query that deletes the
first n documents from a given index. The only thing I found relating to
restricting the size were the from/size parameters http://www.**
elasticsearch.org/guide/**reference/api/search/from-**size/http://www.elasticsearch.org/guide/reference/api/search/from-size/ but
as far as I'm aware that isn't compatible with the query DSL. I also found
the limit query but that only limits the documents to retrieve per
shard. I'm probably missing something really obvious but I'm completely
stumped.

Any help would be greatly appreciated, Thanks

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/Ir8WBt_lUjc/unsubscribe?hl=en-US
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.