code: def reindex_submitted_analyses(portal):
      
      logger.info("Reindex submitted analyses")
      brains = api.search({}, "bika_analysis_catalog")
  
      total = len(brains)
      logger.info("Processing {} analyses".format(total))
  
      for num, brain in enumerate(brains):
          # skip analyses which have an analyst
          if brain.getAnalyst:
              continue
          # reindex analyses which have no annalyst set, but a result
          if brain.getResult not in ["", None]:
              analysis = brain.getObject()
              analysis.reindexObject()
          if num > 0 and num % 5000 == 0:
              logger.info("Commiting reindexed analyses {}/{} ..."
                          .format(num, total))
              transaction.commit()
docs: Reindex submitted analyses