Delete by id

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Delete by id

mooky
Is there simple way to delete a document by id?
(without having to build a query)

Reply | Threaded
Open this post in threaded view
|

Re: Delete by id

Clinton Gormley
On Wed, 2010-11-17 at 11:24 -0800, Mooky wrote:
> Is there simple way to delete a document by id?
> (without having to build a query)


curl -XDELETE 'http://127.0.0.1:9200/my_index/my_type/123' 

Amazing what one can find in the docs ;)

http://www.elasticsearch.com/docs/elasticsearch/rest_api/


Reply | Threaded
Open this post in threaded view
|

Re: Delete by id

mooky
Sorry. I didnt add some context to my question - Im working with the java api.
(java api docs are pretty light/sparse)

-Nick

On 17 November 2010 19:53, Clinton Gormley <[hidden email]> wrote:
On Wed, 2010-11-17 at 11:24 -0800, Mooky wrote:
> Is there simple way to delete a document by id?
> (without having to build a query)


curl -XDELETE 'http://127.0.0.1:9200/my_index/my_type/123'

Amazing what one can find in the docs ;)

http://www.elasticsearch.com/docs/elasticsearch/rest_api/



Reply | Threaded
Open this post in threaded view
|

Re: Delete by id

kimchy
Administrator
Something wrong with this method on the client (the javadoc does not look sparse to me, but if it does to you, you are more than welcomed to send a pull request with improvements):

    /**
     * Deletes a document from the index based on the index, type and id.
     *
     * @param index The index to delete the document from
     * @param type  The type of the document to delete
     * @param id    The id of the document to delete
     */
    DeleteRequestBuilder prepareDelete(String index, String type, String id);


On Thu, Nov 18, 2010 at 1:43 AM, Nick Minutello <[hidden email]> wrote:
Sorry. I didnt add some context to my question - Im working with the java api.
(java api docs are pretty light/sparse)

-Nick


On 17 November 2010 19:53, Clinton Gormley <[hidden email]> wrote:
On Wed, 2010-11-17 at 11:24 -0800, Mooky wrote:
> Is there simple way to delete a document by id?
> (without having to build a query)


curl -XDELETE 'http://127.0.0.1:9200/my_index/my_type/123'

Amazing what one can find in the docs ;)

http://www.elasticsearch.com/docs/elasticsearch/rest_api/




Reply | Threaded
Open this post in threaded view
|

Re: Delete by id

mooky

My Bad. I was looking at prepareDeleteByQuery ... momentary
blindness :-/






On Nov 18, 12:04 am, Shay Banon <[hidden email]> wrote:

> Something wrong with this method on the client (the javadoc does not look
> sparse to me, but if it does to you, you are more than welcomed to send a
> pull request with improvements):
>
>     /**
>      * Deletes a document from the index based on the index, type and id.
>      *
>      * @param index The index to delete the document from
>      * @param type  The type of the document to delete
>      * @param id    The id of the document to delete
>      */
>     DeleteRequestBuilder prepareDelete(String index, String type, String
> id);
>
> On Thu, Nov 18, 2010 at 1:43 AM, Nick Minutello <[hidden email]>wrote:
>
>
>
> > Sorry. I didnt add some context to my question - Im working with the java
> > api.
> > (java api docs are pretty light/sparse)
>
> > -Nick
>
> > On 17 November 2010 19:53, Clinton Gormley <[hidden email]>wrote:
>
> >> On Wed, 2010-11-17 at 11:24 -0800, Mooky wrote:
> >> > Is there simple way to delete a document by id?
> >> > (without having to build a query)
>
> >> curl -XDELETE 'http://127.0.0.1:9200/my_index/my_type/123'
>
> >> Amazing what one can find in the docs ;)
>
> >>http://www.elasticsearch.com/docs/elasticsearch/rest_api/
Reply | Threaded
Open this post in threaded view
|

Re: Delete by id

DougMcq
This post has NOT been accepted by the mailing list yet.
This post was updated on .
In reply to this post by Clinton Gormley
Clinton,
Attempting to delete by ID :-(
Syntax appears to follow your example (index  & type have been verified)
Perchance is using URL as ID contributing to this problem?
To date, this has not been an issue
Thx,
Doug

No handler found for uri [/bupsper/google/http://domain.com/warehouse/catalog/product_info.php?products_id=382] and method [DELETE]