With PK equasl id field . I can do the next query in aql
select * from test.tabletest where PK = ‘1’
and aql shows me
| id | name |
±—±----------+
| 1 | “david” |
±—±----------+
I want to make the same with java. I had tryed to create a filter like this:
com.aerospike.client.query. Filter.equal(“PK”,“1”)); but when I am executing the nex method in aeropike recordSet the method throws the follow exception:
com.aerospike.client.AerospikeException: Error Code 204: Index error
I don’t believe filters work on the primary key either, so you’ll have to create a second field that contains the data of the primary key again and index it.
Limited to 3 posts per topic, so continuing my post here…
For my use case I needed to do a range based query on our primary key. So we had to create a second field to do the range based query on. The simple equals case as was mentioned works by just doing a direct access with the key.
I can’t create a secondary index for each table PK. My problem is the limiatation of the number of secondary index (only 256). In my use case I can’t detreminate the table number because is a generic solution.