How to update index using java api?

Hi

I have created index using Rabbitmq.
my database table contain the following Fields and values:

RecordId Name Address Age

1 abc xxx1 11
2 def xxx2 12
3 ghi xxx3 13
4 jkl xxx4 14
5 mno xxx5 15

For indexing,i have follow the following steps:

  1. create j'son document for each record for eg.
    {"recordid":"1","name":"abc","address":"xxx1","age":"11"} .
  2. after preparing j son document publish into Rabbitmq queue.
    3 i have consumer class that listen those message and create
    index(using Bulk API) here is the code- https://gist.github.com/1330001

it's create an index smoothly.i have question to you if i have made my
updation,insertion or deletion in record's from database,then this
case i should need to update index also.how i am able to update
index(for both three case)?please help me how to make updated index.

Thanks

Just push your new version of the document with the SAME ID. ES will update it.

David :wink:

Le 1 nov. 2011 à 06:42, sam mishra.sameek@gmail.com a écrit :

Hi

I have created index using Rabbitmq.
my database table contain the following Fields and values:

RecordId Name Address Age

1 abc xxx1 11
2 def xxx2 12
3 ghi xxx3 13
4 jkl xxx4 14
5 mno xxx5 15

For indexing,i have follow the following steps:

  1. create j'son document for each record for eg.
    {"recordid":"1","name":"abc","address":"xxx1","age":"11"} .
  2. after preparing j son document publish into Rabbitmq queue.
    3 i have consumer class that listen those message and create
    index(using Bulk API) here is the code- This class will consume the queue messages and create index using bulk api · GitHub

it's create an index smoothly.i have question to you if i have made my
updation,insertion or deletion in record's from database,then this
case i should need to update index also.how i am able to update
index(for both three case)?please help me how to make updated index.

Thanks