code: private void registerRefEntityIndexActions() {
      // bidirectional attribute: register indexing actions for other side
      getEntityType()
          .getMappedByAttributes()
          .forEach(
              mappedByAttr -> {
                EntityType refEntity = mappedByAttr.getRefEntity();
                indexActionRegisterService.register(refEntity, null);
              });
  
      getEntityType()
          .getInversedByAttributes()
          .forEach(
              inversedByAttr -> {
                EntityType refEntity = inversedByAttr.getRefEntity();
                indexActionRegisterService.register(refEntity, null);
              });
    }
docs: Register index actions for entity types with bidirectional attribute values.