Get & delete document


(Tomasz Kloc) #1

Hello,

To use get or delete method i need to know document's ID. What solution
is better:

  • store ID of indexed document in my main database with object which
    was indexed (needs extra write operation on database)
  • filter for certain document to get its ID and then delete (needs
    extra query to ES)

P.S. In online docs ID is an integer, but in ES I see random string. Is
documentation outdated?

tk


(avasilenko) #2

Hello Tomasz,

You can combine filtering and deleting document, by using delete by query -
http://www.elasticsearch.org/guide/reference/api/delete-by-query.html

Regards,
Alexandr Vasilenko

2011/11/3 Tomasz Kloc tomek.kloc.iit@gmail.com

Hello,

To use get or delete method i need to know document's ID. What solution is
better:

  • store ID of indexed document in my main database with object which was
    indexed (needs extra write operation on database)
  • filter for certain document to get its ID and then delete (needs extra
    query to ES)

P.S. In online docs ID is an integer, but in ES I see random string. Is
documentation outdated?

tk


(Tomasz Kloc) #3

Thanks!

One more question. Is there a possibility to update indexed document? Or
should I delete and then reindex?

On 03.11.2011 10:17, Alex Vasilenko wrote:

Hello Tomasz,

You can combine filtering and deleting document, by using delete by
query -
http://www.elasticsearch.org/guide/reference/api/delete-by-query.html

Regards,
Alexandr Vasilenko

2011/11/3 Tomasz Kloc <tomek.kloc.iit@gmail.com
mailto:tomek.kloc.iit@gmail.com>

Hello,

To use get or delete method i need to know document's ID. What
solution is better:
 * store ID of indexed document in my main database with object
which was indexed (needs extra write operation on database)
 * filter for certain document to get its ID and then delete
(needs extra query to ES)

P.S. In online docs ID is an integer, but in ES I see random
string. Is documentation outdated?

tk

(Clinton Gormley) #4

Hi Tomasz

To use get or delete method i need to know document's ID. What solution
is better:

  • store ID of indexed document in my main database with object which
    was indexed (needs extra write operation on database)
  • filter for certain document to get its ID and then delete (needs
    extra query to ES)

Presumably your docs already have an ID in your database, so why not
just use that ID when indexing your docs in ES?

P.S. In online docs ID is an integer, but in ES I see random string. Is
documentation outdated?

An ID in ES is a string, but that string can contain just numbers.

clint


(Tomasz Kloc) #5

On 03.11.2011 10:23, Clinton Gormley wrote:

Hi Tomasz

To use get or delete method i need to know document's ID. What solution
is better:

  • store ID of indexed document in my main database with object which
    was indexed (needs extra write operation on database)
  • filter for certain document to get its ID and then delete (needs
    extra query to ES)

Presumably your docs already have an ID in your database, so why not
just use that ID when indexing your docs in ES?

I wasn't aware of that feature, thanks.


(system) #6