Update documents with reindex


(Gili Sade) #1

Hi all
I have an index which contains the fields likes and reviews.
We load the index using jdbc input with logstash.
Every night we need to delete the index and reload it from the Oracle db.
But we need to keep the fields mentioned above.
So I tried reindexing these fields to a temporary index . Then deleteing the I main index. Reloading it with logstash .
Then I tried to reindex back the fields of likes and reviews from the temporary index i've created.
What happened is , it just did an overwrite to the whole document instead of just updating the fields of likes and reviews. Tried changing the version_type to external , but it did not work .

Worth mentioning that the documents in the main index get updated so their version is usually higher than 1.

Using ES 5.3
any ideas ?


(Luiz Santos) #2

Hi @gilisade,

You should use the update API to not overwrite the hole document.

I think another more straightforward solution would be to adjust the logstash elasticsearch output action to use update.

Cheers,
LG


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.