diff --git a/spring-5-data-reactive/src/main/java/com/baeldung/couchbase/configuration/ReactiveCouchbaseConfiguration.java b/spring-5-data-reactive/src/main/java/com/baeldung/couchbase/configuration/ReactiveCouchbaseConfiguration.java index 2f3b5486d8..a51b19ee22 100644 --- a/spring-5-data-reactive/src/main/java/com/baeldung/couchbase/configuration/ReactiveCouchbaseConfiguration.java +++ b/spring-5-data-reactive/src/main/java/com/baeldung/couchbase/configuration/ReactiveCouchbaseConfiguration.java @@ -2,7 +2,11 @@ package com.baeldung.couchbase.configuration; import com.couchbase.client.java.env.CouchbaseEnvironment; import com.couchbase.client.java.env.DefaultCouchbaseEnvironment; + +import org.springframework.context.annotation.Bean; import org.springframework.data.couchbase.config.AbstractReactiveCouchbaseConfiguration; +import org.springframework.data.couchbase.config.BeanNames; +import org.springframework.data.couchbase.repository.support.IndexManager; import java.util.List; @@ -36,4 +40,9 @@ public abstract class ReactiveCouchbaseConfiguration extends AbstractReactiveCou .bootstrapHttpDirectPort(couchbaseProperties.getPort()) .build(); } + + @Bean(name = BeanNames.COUCHBASE_INDEX_MANAGER) + public IndexManager couchbaseIndexManager() { + return new IndexManager(true, true, false); + } } diff --git a/spring-5-data-reactive/src/main/java/com/baeldung/couchbase/domain/repository/view/ViewPersonRepository.java b/spring-5-data-reactive/src/main/java/com/baeldung/couchbase/domain/repository/view/ViewPersonRepository.java index 28a7ec1b78..06c47c2393 100644 --- a/spring-5-data-reactive/src/main/java/com/baeldung/couchbase/domain/repository/view/ViewPersonRepository.java +++ b/spring-5-data-reactive/src/main/java/com/baeldung/couchbase/domain/repository/view/ViewPersonRepository.java @@ -13,7 +13,7 @@ import java.util.UUID; @ViewIndexed(designDoc = ViewPersonRepository.DESIGN_DOCUMENT) public interface ViewPersonRepository extends ReactiveCrudRepository { - String DESIGN_DOCUMENT = "persons"; + String DESIGN_DOCUMENT = "person"; @View(designDocument = ViewPersonRepository.DESIGN_DOCUMENT) Flux findByFirstName(String firstName);