I tried this:
CREATE INDEX recipient_id ON gifts.received (recipient) STRING
from the example provided in Aerospike’s documentation:
CREATE INDEX user_age_idx ON users.profiles (age) NUMERIC
But when I make a query on it:
SELECT * FROM gifts.received WHERE recipient = "rfoazicxqezrxivc"
Here’s what I get as a response:
0 rows in set (0.000 secs)
Error: (201) AEROSPIKE_ERR_INDEX_NOT_FOUND
But when I display the whole set:
SELECT * FROM gifts.received
+--------------------+--------------------+------------+
| sender | recipient | time_sent |
+--------------------+--------------------+------------+
| "trezretazecdsfdr" | "rfoazicxqezrxivc" | 1489513314 |
+--------------------+--------------------+------------+
1 row in set (0.344 secs)
Also, the secondary key seems to be OK:
show indexes
+---------+-------------+-----------+------------+-------+----------------+-------------+------------+----------+
| ns | bin | indextype | set | state | indexname | path | sync_state | type |
+---------+-------------+-----------+------------+-------+----------------+-------------+------------+----------+
| "gifts" | "recipient" | "NONE" | "received" | "RW" | "recipient_id" | "recipient" | "synced" | "STRING" |
+---------+-------------+-----------+------------+-------+----------------+-------------+------------+----------+
1 row in set (0.000 secs)
OK
So I don’t understand… The value is correct, the bin appears in the set, but when I try to make a query as shown in the documentation, it doesn’t work. I don’t see what I did that’s fundamentally different from the documentation… I did everything it says.