title: Consider revisiting the entries above or defining a bean of type 'org.springframework.data.redis.core.RedisTemplate' in your configuration
body: <p>I am getting the below error when developing the <code>Spring Boot + Spring Data Redis</code> example. In this example, I'm looking to implement <code>contains</code> method which is not possible as per spring doc and link here : <a href="https://stackoverflow.com/questions/53134556/caused-by-java-lang-illegalargumentexception-containing-1-iscontaining-co">Caused by: java.lang.IllegalArgumentException: CONTAINING (1): [IsContaining, Containing, Contains]is not supported for redis query derivation - Redis</a> which will pull data as per matching details. </p>
  
  <pre><code>***************************
  APPLICATION FAILED TO START
  ***************************
  
  Description:
  
  Field redisTemplate in com.baeldung.MainAppDemo required a bean of type 'org.springframework.data.redis.core.RedisTemplate' that could not be found.
  
  The injection point has the following annotations:
      - @org.springframework.beans.factory.annotation.Autowired(required=true)
  
  The following candidates were found but could not be injected:
      - Bean method 'redisTemplate' in 'RedisAutoConfiguration' not loaded because @ConditionalOnMissingBean (names: redisTemplate; SearchStrategy: all) found beans named redisTemplate
  
  
  Action:
  
  Consider revisiting the entries above or defining a bean of type 'org.springframework.data.redis.core.RedisTemplate' in your configuration.
  </code></pre>
  
  <p>I have implemented method like below
  <strong>MainAppDemo.java</strong></p>
  
  <pre><code>@SpringBootApplication
  public class MainAppDemo implements CommandLineRunner{
  
      @Autowired
      private UserRepository userRepository;
  
      @Autowired
      private RedisTemplate&lt;String, Object&gt; redisTemplate;
  
      public static void main(String[] args) {
          SpringApplication.run(MainAppDemo.class, args);
      }
  
      @Override
      public void run(String... args) throws Exception {
          Role role1 = Role.builder().id("R1").roleName("ADMIN").build();
          User user1 = User.builder().firstName("Matt").middleName("Mike").lastName("Wixson").role(role1).build();
  
          Role role2 = Role.builder().id("R2").roleName("API").build();
          User user2 = User.builder().firstName("John").middleName("Lima").lastName("Kerr").role(role2).build();
  
          userRepository.save(user1);
          userRepository.save(user2);
  
          List&lt;User&gt; u = userRepository.findByFirstNameAndLastName("Matt", "Wixson");
          System.out.println("Find By First Name and Last Name = "+u.toString());
  
          final String key = String.format("user:%s", "J");
          final String firstName = (String) redisTemplate.opsForHash().get(key, "firstName");
          final String middleName = (String) redisTemplate.opsForHash().get(key, "middleName");
          final String lastName = (String) redisTemplate.opsForHash().get(key, "lastName");
  
          User user = User.builder().firstName(firstName).middleName(middleName).lastName(lastName).build();
          System.out.println("Custom Redis Template Example ="+user.toString());
  
          List&lt;User&gt; adminUser = userRepository.findByRole_RoleName("ADMIN");
          System.out.println("ADMIN USER ="+adminUser);
      }
  }
  </code></pre>
  
  <p><strong>RedisConfig.java</strong></p>
  
  <pre><code>@Configuration
  @ConfigurationProperties
  @EnableRedisRepositories("com.baeldung.spring.data.redis.repository")
  public class RedisConfig {
      @Bean
      JedisConnectionFactory jedisConnectionFactory() {
          return new JedisConnectionFactory();
      }
      @Bean
      RedisTemplate&lt;Object, Object&gt; redisTemplate() {
          final RedisTemplate&lt;Object, Object&gt; template = new RedisTemplate&lt;&gt;();
          template.setConnectionFactory(jedisConnectionFactory());
          template.setKeySerializer(new StringRedisSerializer());
          template.setHashValueSerializer(new GenericToStringSerializer&lt;Object&gt;(Object.class));
          template.setValueSerializer(new GenericToStringSerializer&lt;Object&gt;(Object.class));
          return template;
      }
  }
  </code></pre>
  
  <p><strong>User.java</strong></p>
  
  <pre><code>@Data
  @Builder
  @AllArgsConstructor
  @NoArgsConstructor
  @RedisHash("user")
  public class User {
      private @Id String id;
      private @Indexed String firstName;
      private @Indexed String middleName;
      private @Indexed String lastName;
      private Role role;
  }
  </code></pre>
  
  <p>Role.java</p>
  
  <pre><code>@Data 
  @Builder
  @AllArgsConstructor
  @NoArgsConstructor
  @RedisHash("Role")
  public class Role {
      private @Id String id;
      private @Indexed String roleName;
  }
  </code></pre>