viur-framework/viur-cli

Remove duplicate index in `index.yaml`

Closed this issue · 2 comments

If you insert an index into index.yaml which already exists there, the duplicate should be removed instead of sorting it twice in a row.

Can you elaborate this further somehow?

Can you elaborate this further somehow?

Imagine this it the content of my index.yaml:

indexes:

- kind: file
  properties:
  - name: weak
  - name: creationdate

- kind: file
  properties:
  - name: parententry
  - name: sortindex

# and many more entries
# ...
# ...
# ...

Now I add the index (which exist in the index.yaml already) at the end.

- kind: file
  properties:
  - name: weak
  - name: creationdate

the index.yaml becomes sorted:

indexes:

- kind: file
  properties:
  - name: weak
  - name: creationdate

- kind: file
  properties:
  - name: weak
  - name: creationdate

- kind: file
  properties:
  - name: parententry
  - name: sortindex

# and many more entries
# ...
# ...
# ...

and contains the "new" added index twice. But the viur-cli could detect the duplicate and eliminate it.