Skip to content

Fix version_type in popularity update #1111

Open
@MatMoore

Description

@MatMoore

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions