Handle auto index on field path. (#1169)
Closes #1166. Co-authored-by: mikereiche <michael.reiche@couchbase.com>
This commit is contained in:
@@ -23,6 +23,7 @@ import org.springframework.data.couchbase.core.mapping.Document;
|
||||
|
||||
@Document
|
||||
@CompositeQueryIndex(fields = { "id", "name desc" })
|
||||
@CompositeQueryIndex(fields = { "id.something", "name desc" })
|
||||
public class Airline extends ComparableEntity {
|
||||
@Id String id;
|
||||
|
||||
|
||||
@@ -62,6 +62,14 @@ public class CouchbaseRepositoryAutoQueryIndexIntegrationTests extends ClusterAw
|
||||
assertTrue(foundIndex.get().condition().get().contains("_class"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void createsCompositeIndexWithPath() {
|
||||
Optional<QueryIndex> foundIndex = cluster.queryIndexes().getAllIndexes(bucketName()).stream()
|
||||
.filter(i -> i.name().equals("idx_airline_id_something_name")).findFirst();
|
||||
|
||||
assertTrue(foundIndex.isPresent());
|
||||
assertTrue(foundIndex.get().condition().get().contains("_class"));
|
||||
}
|
||||
@Configuration
|
||||
@EnableCouchbaseRepositories("org.springframework.data.couchbase")
|
||||
static class Config extends AbstractCouchbaseConfiguration {
|
||||
|
||||
Reference in New Issue
Block a user