Skip to content

Removing a node from the index does not remove the variants in all case #285

Open

Description

@dfeyer

Given I have a node in dimension A, on a website with 2 dimanesions A and B and my node does not exist in dimension B

During indexing we create two document in the index one for dimension A and one for dimension B.

If I remove the node in dimension A, the document in this dimension is removed correctly but the one in the dimension B. It's not a big issue, because the document of the Elastic query are filtered and only existing document in the CR are returned.

But it's not clean ;) and in some case it can have an impact on the query algorythm, because Elastic use data that are not in sync with the CR.

Affected version: all

Possible solution

It's a bit complexe, in my case it's easy, we can remove all variants (because node does not exist in dimension B).

But it's a valid case, to have the node in both A and B dimensions, but only removing the one in dimension A (in this case the current behaviour is correct.

So we have two scenario:

  1. Node existe in all dimensions and remove works as expected
  2. Node exists only in a subset off all dimensions in this case the content of the index is out of sync as soon as we delete the node in one or some dimensions (but not all)

How to detect those two scenario ?

Activity

  1. dfeyer commented on Nov 7, 2018

    @dfeyer
    ContributorAuthor

    One possible solution:

    • Remove the node
    • Iterate over all existing variants (only existing one), remove docs in Elastic
    • Iterate over ContentDimensionsPreset, then:
      • remove all doc from the index
      • check if node exist in the CR, reindex those nodes only

    Needs to modularize a bit the NodeIndexer::indexNode to extract the closure to handle single variant indexing, but I think that should works.

    And by the way the indexed content of a variant node, can depends on the other variants (contenu shine throw, so refreshing the index is maybe a good idea here.

  2. changed the title [-]Removing a node from the index does not remove the variants[/-] on Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions