private void createIndexesIfNecessary() {
        val indexesOnNamespaces = new HashSet<String>();
        redisModulesOperations.ifPresent(ops ->
            redisKeyGeneratorFactory.getRedisKeyGenerators()
                .stream()
                .filter(RedisKeyGenerator::isTicketKeyGenerator)
                .forEach(redisKeyGenerator -> {
                    val prefix = redisKeyGenerator.getNamespace() + ':';
                    if (!indexesOnNamespaces.contains(prefix)) {
                        val fields = CollectionUtils.wrapList(
                            RedisTicketDocument.FIELD_NAME_ID,
                            RedisTicketDocument.FIELD_NAME_ATTRIBUTES,
                            RedisTicketDocument.FIELD_NAME_PRINCIPAL,
                            RedisTicketDocument.FIELD_NAME_TYPE,
                            RedisTicketDocument.FIELD_NAME_SERVICE,
                            RedisTicketDocument.FIELD_NAME_PREFIX);
                        ops.createIndexes(SEARCH_INDEX_NAME, prefix, fields);
                        indexesOnNamespaces.add(prefix);
                    }
                }));
    }
Key-value ticket registry implementation that stores tickets in redis.

@author Misagh Moayyed
@author Jerome Leleu
@since 5.1.0
support/cas-server-support-redis-ticket-registry/src/main/java/org/apereo/cas/ticket/registry/RedisTicketRegistry.java