search-api icon indicating copy to clipboard operation
search-api copied to clipboard

Fix version_type in popularity update

Open MatMoore opened this issue 8 years ago • 0 comments

From: https://trello.com/c/xiYv8sH9/38-fix-versiontype-in-popularity-update

We set '_version_type' => 'external_gte' on every document when updating the popularity data: https://github.com/alphagov/rummager/blob/master/lib/govuk_index/popularity_worker.rb#L23

This is correct for the govuk which uses external versioning, but incorrect for mainstream, government and detailed, which use internal versioning (the default).

This doesn't cause any race conditions in those indices because we don't use optimistic locking when updating the non-govuk indices anyway.

But it is confusing, because it implies that we use versioning in non-govuk indices when we don't. This has slowed down our investigation of search duplicates because we weren't sure if the mix of versioning systems could cause duplicates of documents. (It can't, as far as we know, but we wasted time investigating it.)

More on ES versioning: https://www.elastic.co/blog/elasticsearch-versioning-support

MatMoore avatar Dec 18 '17 18:12 MatMoore