Class CategoryDeleteCascadeService

java.lang.Object
org.alfresco.elasticsearch.batchindexing.cascade.CategoryDeleteCascadeService

public class CategoryDeleteCascadeService extends Object
Cascades a category delete by pruning the deleted UUID from every referring document's CATEGORIES_FIELD (cm%3Acategories), CATEGORY_ANCESTOR and PARENT arrays, and stripping PATH / UNPREFIXED_PATH entries that contain any of the deleted category's paths, via a single _update_by_query. Mirrors live indexing's PathUpdaterProcessor#removeDeletedCategoryFromChildNode.

Idempotent; version conflicts are set to proceed so concurrent live-indexing writes don't abort the cascade.

Fidelity gap: live indexing recomputes CATEGORY_ANCESTOR from surviving categories, dropping upstream uuids exclusive to the deleted category's chain. We don't — options considered were either O(referring-docs × surviving-cats) mgets or only partially correct. Stale uuids are corrected by the next full reindex and do not affect query correctness.

  • Constructor Details

    • CategoryDeleteCascadeService

      public CategoryDeleteCascadeService(org.opensearch.client.opensearch.OpenSearchClient openSearchClient, org.alfresco.indexing.shared.ElasticsearchProperties elasticsearchProperties, CascadeProperties cascadeProperties)
  • Method Details

    • apply

      public long apply(CategoryDeleteCascadeSource source)
      Apply the category-delete cascade for one source.
      Returns:
      number of referring docs mutated, or 0 when skipped.