Link followed :- https://www.aerospike.com/blog/spring-data-for-aerospike/
We have an below sample Entity :-
@Document(collection = "cust", expiration = 90, expirationUnit = TimeUnit.DAYS)
public class Customer {
@Id
@Field(value = "PK")
private String custId;
@Field(value = "mobileNumber")
private String mobileNumber;
@Field(value = "creationTime")
private String creationTime;
@Field(value = "custType")
private String custType;
}
Using the Spring-repository, We are using below method :-
// WORKS
List<Customer> findByMobileNumber (String mobileNumber);
// FAILS with 201 ERR INNDEX NOT FOUND.
List<Customer> findByMobileNumberAndCustType (String mobileNumber, String customerType);
Facts / Observations :-
1.) We have not created any explicit secondary indices on our aerospike-set.
2.) When we query(select * from test.cust where mobileNumber = ‘981XXXXXXX’) for the same record using AQL,it fails giving us an error of Indices not found.
Concerns / Questions :-
a.) How does the first one method is working ? What’s the internal way of it being executed ? Are there any on the fly, secondary indices getting created and getting washed away as soon as query is done ?
b.) Why the second one fails ?
Any response shall be highly appreciated !!
See Question&Answers more detail:os