Delete items for a given range


(Kartik) #1

Hello,

I was wondering if there is a way to delete all the items for a given
range of timestamps.

I tried looking for possible answers online and found a few entries
that indicate that this is possible, but no definite answer confirming
this. (aka bulk api)

I am aware of ElasticSearch allowing you to search for entries for a
given time range but does anyone know of a better way of doing ranged
deletions except of deleting entries individually after you get them
from the range query.

Thanks for your time.

Kartik


(Ivan Brusic) #2

You can execute a delete by query with the same range query you are using:

http://www.elasticsearch.org/guide/reference/java-api/delete-by-query.html

--
Ivan

On Wed, Mar 21, 2012 at 3:58 PM, Kartik talwar.kartik@gmail.com wrote:

Hello,

I was wondering if there is a way to delete all the items for a given
range of timestamps.

I tried looking for possible answers online and found a few entries
that indicate that this is possible, but no definite answer confirming
this. (aka bulk api)

I am aware of ElasticSearch allowing you to search for entries for a
given time range but does anyone know of a better way of doing ranged
deletions except of deleting entries individually after you get them
from the range query.

Thanks for your time.

Kartik


(Kartik) #3

Hello Ivan,

Thanks for your reply.

I was more interested in doing that through their REST interface.

Do you know if that's still possible?

Thanks

On Mar 22, 3:40 pm, Ivan Brusic i...@brusic.com wrote:

You can execute a delete by query with the same range query you are using:

http://www.elasticsearch.org/guide/reference/java-api/delete-by-query...

--
Ivan

On Wed, Mar 21, 2012 at 3:58 PM, Kartik talwar.kar...@gmail.com wrote:

Hello,

I was wondering if there is a way to delete all the items for a given
range of timestamps.

I tried looking for possible answers online and found a few entries
that indicate that this is possible, but no definite answer confirming
this. (aka bulk api)

I am aware of ElasticSearch allowing you to search for entries for a
given time range but does anyone know of a better way of doing ranged
deletions except of deleting entries individually after you get them
from the range query.

Thanks for your time.

Kartik


(Ivan Brusic) #4

I should have linked to the REST API:

http://www.elasticsearch.org/guide/reference/api/delete-by-query.html

On Fri, Mar 23, 2012 at 11:49 AM, Kartik talwar.kartik@gmail.com wrote:

Hello Ivan,

Thanks for your reply.

I was more interested in doing that through their REST interface.

Do you know if that's still possible?

Thanks

On Mar 22, 3:40 pm, Ivan Brusic i...@brusic.com wrote:

You can execute a delete by query with the same range query you are using:

http://www.elasticsearch.org/guide/reference/java-api/delete-by-query...

--
Ivan

On Wed, Mar 21, 2012 at 3:58 PM, Kartik talwar.kar...@gmail.com wrote:

Hello,

I was wondering if there is a way to delete all the items for a given
range of timestamps.

I tried looking for possible answers online and found a few entries
that indicate that this is possible, but no definite answer confirming
this. (aka bulk api)

I am aware of ElasticSearch allowing you to search for entries for a
given time range but does anyone know of a better way of doing ranged
deletions except of deleting entries individually after you get them
from the range query.

Thanks for your time.

Kartik


(medcl.net) #5

hey,guys, I just pushed a plugin integrated with
carrot2(http://carrot2.org),

here is the repo:

how to instsall?

1.download lexical
files(https://github.com/downloads/medcl/elasticsearch-carrot2/config.zip),put
them into the config folder.
2.bin/plugin install medcl/elasticsearch-carrot2/1.0

how to use?

curl -XPOST
http://localhost:9200/elasticsearch_resources/_carrot2?carrot2.fetch_size=1800&carrot2.language=ENGLISH&carrot2.title_fields=title&carrot2.summary_fields=snippet&carrot2.url_field=url&carrot2.attach_detail=true
-d'
{
"query": {
"bool": {
"should": [
{
"match_all": {}
}
]
}
},
"from": 0,
"size": 10
}
'

a response sample:

BTW,this is a early version just for preview,will be improved later.

have fun.thanks.


(system) #6