[ BAEL-1869 ] : Restroe indexManager, fix view name to be equal to the snippet

This commit is contained in:
Lukasz Rys 2019-09-17 09:21:43 +02:00
parent 32e77c7f9c
commit 1b85cbaafd
2 changed files with 10 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -13,7 +13,7 @@ import java.util.UUID;
@ViewIndexed(designDoc = ViewPersonRepository.DESIGN_DOCUMENT)
public interface ViewPersonRepository extends ReactiveCrudRepository<Person, UUID> {
String DESIGN_DOCUMENT = "persons";
String DESIGN_DOCUMENT = "person";
@View(designDocument = ViewPersonRepository.DESIGN_DOCUMENT)
Flux<Person> findByFirstName(String firstName);