code: def remove_stale_indexes_from_bika_catalog(portal):
      
      logger.info("Removing stale indexes and metadata from bika_catalog ...")
      cat_id = "bika_catalog"
      indexes_to_remove = [
          "getAnalyst",
          "getAnalysts",
          "getAnalysisService",
          "getClientOrderNumber",
          "getClientReference",
          "getClientSampleID",
          "getContactTitle",
          "getDateDisposed",
          "getDateExpired",
          "getDateOpened",
          "getDatePublished",
          "getInvoiced",
          "getPreserver",
          "getSamplePointTitle",
          "getSamplePointUID",
          "getSampler",
          "getScheduledSamplingSampler",
          "getSamplingDate",
          "getWorksheetTemplateTitle",
          "BatchUID",
      ]
      metadata_to_remove = [
          "getAnalysts",
          "getClientOrderNumber",
          "getClientReference",
          "getClientSampleID",
          "getContactTitle",
          "getSamplePointTitle",
          "getAnalysisService",
          "getDatePublished",
      ]
      for index in indexes_to_remove:
          del_index(portal, cat_id, index)
  
      for metadata in metadata_to_remove:
          del_metadata(portal, cat_id, metadata)
      commit_transaction(portal)
docs: Removes stale indexes and metadata from bika_catalog. Most of these
      indexes and metadata were used for Samples, but they are no longer used.