I’m facing this error while trying to retrieve record based on a secondary index. Here’s my query
select * from caas.content where topic_id='GUID-E8E101ED-A9BC-46E8-A89F-8F1327B1AA44'
0 rows in set (0.001 secs)
Error: (201) AEROSPIKE_ERR_INDEX_NOT_FOUND
I’ve a secondary index on the field topic_id. Not sure what’s the issue is. I dropped and recreated the index, but didn’t make any difference. Here’s my index view
Based on your screen capture, the “num_bins” is not 1.
Are you using AMC to create the index or was through code/client?
I did it (create 2 indexes over the same set) thru AMC and I didn’t have any problems
The indices probably apply to around 8 million documents. I once again dropped the index from the node (missing bin entry), restarted it, after a while it seemed to have started on its own. Not sure if it’s fixed for all topic ids or few of them. There’s no easy way for me to know right row. But, I’m curious to know what might be the probable cause? Is it recommended to create an index before populating the document ? Can creating a new index on an existing document lead to a problem like this?
The problem here is your query is going against caas.content (namespace = caas, set = content).
Your secondary index is defined as caas.caascontent (namespace = caas, set = caascontent). So your query really is against a non-existent secondary index.