I can’t understand as to why this error is occuring. Here’s my simple code:
from __future__ import print_function
import aerospike
from aerospike import predicates as p
def print_result((key, metadata, record)):
print(key, metadata, record)
config = {
'hosts': [
( '127.0.0.1', 3000 )
],
'policies': {
'timeout': 1000
}
}
try:
client = aerospike.client(config).connect()
except ClientError as e:
print("Error: {0} [{1}]".format(e.msg, e.code))
sys.exit(1)
client.put(('test', 'test', 1), {
'timestamp': 123456789,
'data' : [1, 2, 3, 4, 5]
})
client.put(('test', 'test', 2), {
'timestamp': 123456788,
'data' : [11, 12, 13, 14, 15]
})
query = client.query('test', 'test')
query.select('timestamp', 'data')
query.where( p.equals('timestamp', 123456789) )
records = query.results()
pp.pprint(records)
client.close()
this returns: Traceback (most recent call last): File “testquery.py”, line 36, in records = query.results() exception.IndexNotFound: (201L, ‘AEROSPIKE_ERR_INDEX_NOT_FOUND’, ‘src/main/aerospike/aerospike_query.c’, 335)