Reputation: 1578
I have implemented a project with spring boot and couchbase.
I also defined auto-index:true . On Couchbase console , I can see the views under "Production Views" section but coucshbase still gives me the error below:
No index available on keyspace todolist that matches your query. Use CREATE INDEX or CREATE PRIMARY INDEX to create an index, or check that your expected index is online
So can someone tell me that what I am missing?
Thx
Upvotes: 0
Views: 1026
Reputation: 2460
Couchbase does not recommend using both @N1qlPrimaryIndexed and @ViewIndexed, they are only useful during development
@ViewIndexed - views are on their way out of couchbase, and there are just a few methods like deleteAll that still use them.
You can read a full explanation here: https://docs.couchbase.com/tutorials/spring-data-indexes/spring-index.html
Upvotes: 0
Reputation: 3065
I had this issue when I was running tests against a new bucket in couchbase.
The @N1qlPrimaryIndexed and @ViewIndexed annotations only seemed to create the indexes when I ran the Spring Boot app as an executable Jar.
Upvotes: 0
Reputation: 79
You can try adding this in your CouchbaseConfig class.
@Override
@ConditionalOnMissingBean(name = BeanNames.COUCHBASE_INDEX_MANAGER)
@Bean(name = BeanNames.COUCHBASE_INDEX_MANAGER)
public IndexManager indexManager() {
return new IndexManager(true, true, true);
}
Hope it will helps.
Upvotes: 1