New document version with different custom routing


(andreas.chatzakis) #1

Hi,

On the situation where a new version of a document comes with a new value
for its custom routing parameter, we end up with 2 versions of the same
document id maintained on 2 different shards.

what is the best practice here?

First deleting the document instead of just updating it? Or is there a more
elegant way to achieve the same via the API?

thanks in advance

--


(Clinton Gormley) #2

Hiya

On the situation where a new version of a document comes with a new
value for its custom routing parameter, we end up with 2 versions of
the same document id maintained on 2 different shards.

what is the best practice here?

First deleting the document instead of just updating it? Or is there a
more elegant way to achieve the same via the API?

I'm afraid you have to delete it with the original routing value before
indexing it with the new value. ES only checks the shard that it thinks
the doc is on, so if the routing value has changed, it won't know about
the existing version.

clint

thanks in advance

--

--


(andreas.chatzakis) #3

thanks for confirming our approach

much appreciated

Andreas

On Wednesday, October 3, 2012 5:36:22 PM UTC+3, andreas.chatzakis wrote:

Hi,

On the situation where a new version of a document comes with a new value
for its custom routing parameter, we end up with 2 versions of the same
document id maintained on 2 different shards.

what is the best practice here?

First deleting the document instead of just updating it? Or is there a
more elegant way to achieve the same via the API?

thanks in advance

--


(system) #4